• 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: (void *)contextInfo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: (void *)contextInfo
      • From: Roland King <email@hidden>
References: 
 >(void *)contextInfo (From: Rainer Standke <email@hidden>)

  • Prev by Date: Re: (void *)contextInfo
  • Next by Date: Re: (void *)contextInfo
  • Previous by thread: Re: (void *)contextInfo
  • Next by thread: Re: (void *)contextInfo
  • Index(es):
    • Date
    • Thread