• 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
storage for context: value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

storage for context: value


  • Subject: storage for context: value
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 25 Jul 2013 07:20:20 -0700

I'd like to hear some arguments / opinions / essays on storage of the value passed as context:(void*), not just in addObserver:, but in general - so, including things like beginAnimations:context: and sortedArrayUsingFunction:context:.

Must it always be an external variable? Must it always be stored as a void*? I know there's a standard pattern where it's an external pointing to its own storage:

    static void* const MYCONTEXT = (void*)&MYCONTEXT;

Is this the only safe/sensible storage? Could it be an actual object, cast back and forth between id and void*? Could it be stored as an ivar? Thx as always - m.

--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com


_______________________________________________

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


  • Follow-Ups:
    • Re: storage for context: value
      • From: Quincey Morris <email@hidden>
    • Re: storage for context: value
      • From: Roland King <email@hidden>
    • Re: storage for context: value
      • From: Scott Ribe <email@hidden>
  • Prev by Date: Re: Apple Developer Update
  • Next by Date: NSTask interrupt exception
  • Previous by thread: Re: dev site down time is ridiculous
  • Next by thread: Re: storage for context: value
  • Index(es):
    • Date
    • Thread