storage for context: value
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