Re: Any way to tell if a pointer is an object?
Re: Any way to tell if a pointer is an object?
- Subject: Re: Any way to tell if a pointer is an object?
- From: Sherm Pendley <email@hidden>
- Date: Sun, 25 Feb 2007 04:58:44 -0500
On Feb 25, 2007, at 1:10 AM, Jerry Krinock wrote:
For example, since documentation is not always complete, I often
want to
examine the "(void*)contextInfo" that I get in a callback. Doing
NSLog(@"contextInfo = %@", contextInfo) ;
results in a crash if *contextInfo is not an object.
The context info that's passed to a callback is whatever you passed
to Cocoa in the first place. It's not used or touched by Cocoa, it's
just passed back to your callback as-is. For example, if a sheet
callback -sheetDidEnd:returnCode:contextInfo:, the contextInfo is
whatever you passed to -
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo
when you created the sheet.
So, if you've forgotten what type that is, just look back in your
code to the point at which you asked for the callback.
I'm not certain how the documentation could be "complete" in the
sense of telling you what your own code is doing. :-)
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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