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: Greg Parker <email@hidden>
- Date: Mon, 20 Aug 2012 14:51:26 -0700
On Aug 20, 2012, at 12:52 PM, Jens Alfke <email@hidden> wrote:
> I've just "modernized" a bunch of cross-platform code in Xcode 4.4, to use the new Obj-C literal and collection-access syntax. Works great when built for Mac OS. But now I discover that the code gets tons of compile errors on iOS because in the 5.1 SDK the NSArray and NSDictionary classes don't declare the -objectForKeyedSubscript: or -objectForIndexedSubscript: methods.
>
> Presumably this will be remedied in the hypothetical future release of Xcode that includes the iOS 6 SDK. But is there anything I can do until then to make this build and run on iOS 5.1?
Add a category interface on those classes that declares those methods. Don't implement that category.
> (And does this also imply that code using array/dictionary subscripting won't run on OS X 10.7?)
It implies no such thing.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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