On Wed, Jun 29, 2011 at 10:08 AM, Markus Hanauska <[email protected]> wrote: > Since when do you have to be owner of an object to be allowed to interact > with it?
You're holding on to the result of -value. Therefore you need an ownership reference to it. This is something Cocoa programmers have needed to worry about forever. The canonical example is this: id o = [myArray objectAtIndex:0]; [myArray release]; NSLog(@"%@", [o description]); // <-- CAN CRASH HERE Unless you know you have ownership of the object (directly by retaining it, or indirectly by owning something else that has an owning reference to the object), you can't assume your pointer to the object is valid. > This contradicts pretty much everything Apple has ever documented about > Cocoa/Obj-C. http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html%23//apple_ref/doc/uid/TP40004447-1000922-BABBFBGJ --Kyle Sluder _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
