Re: How to make Obj-C collection subscripting work on iOS 5?
Re: How to make Obj-C collection subscripting work on iOS 5?
- Subject: Re: How to make Obj-C collection subscripting work on iOS 5?
- From: Charles Srstka <email@hidden>
- Date: Mon, 20 Aug 2012 15:53:27 -0500
On Aug 20, 2012, at 2:52 PM, Jens Alfke <email@hidden> wrote:
> My first thought was to declare some categories on NSArray and NSDictionary to define those methods, but that's likely to cause issues when iOS 6 comes out and already includes those methods — I'll get compile errors (which I can work around with #ifdefs) but also a warning at launch time because the methods are declared in two places.
You could put a +load method in your category which dynamically adds the methods at launch time only if they're not already there.
> (And does this also imply that code using array/dictionary subscripting won't run on OS X 10.7?)
No, Apple says that these features should work on earlier OS X release, as long as you're using the modern runtime, probably by using something like the runtime trick above.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden