• 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
Re: Any way to tell if a pointer is an object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Any way to tell if a pointer is an object? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Parsing STDout into an NSDictionary
  • Next by Date: Re: Parsing STDout into an NSDictionary
  • Previous by thread: Re: Any way to tell if a pointer is an object?
  • Next by thread: Re: Any way to tell if a pointer is an object?
  • Index(es):
    • Date
    • Thread