• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to make Obj-C collection subscripting work on iOS 5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to make Obj-C collection subscripting work on iOS 5? (From: Jens Alfke <email@hidden>)

  • Prev by Date: NSSplitView crash upon restore from 10.8 Versions Browser
  • Next by Date: Re: How to make Obj-C collection subscripting work on iOS 5?
  • Previous by thread: How to make Obj-C collection subscripting work on iOS 5?
  • Next by thread: Re: How to make Obj-C collection subscripting work on iOS 5?
  • Index(es):
    • Date
    • Thread