Re: (void *)contextInfo
Re: (void *)contextInfo
- Subject: Re: (void *)contextInfo
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 12 Jan 2010 13:13:11 -0700
On Jan 12, 2010, at 12:51 PM, Rainer Standke wrote:
> The contextinfo's class is logged as NSConcreteMutableData. How can I get back to the array? Why is contextinfo considered to be of class void in the signature?
>
> What am I missing? (Another newbie thing I suspect...)
If you're using RR, then you must manually retain the array, and release it in the did-end selector, because in this case, the autorelease pool is deleting the array, and the pointer is being reassigned. The reason is because contextInfo is a void * and can be set to any memory address, not just an object, so the beginSheet method does not retain the object.
If you're using GC, and the pointer's address is being re-assigned, then it probably got finalized behind your app's back, and so you can emulate retain/release in this case by using the disable/enable methods of NSGarbageCollector.
Nick Zitzmann
<http://www.chronosnet.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