Re: (void *)contextInfo
Re: (void *)contextInfo
- Subject: Re: (void *)contextInfo
- From: "Sean McBride" <email@hidden>
- Date: Tue, 12 Jan 2010 15:25:41 -0500
- Organization: Rogue Research Inc.
On 1/12/10 3:04 PM, Sherm Pendley said:
>Additionally, I'd recommend making theContextInfo into an instance
>variable, rather than passing it through the contextInfo. You can then
>write (or @synthesize) an accessor method that encapsulates all of the
>relevant memory management into one place, which is *far* less
>error-prone than scattering -retain and -release calls all over the
>place.
Additionally, with GC, one must be very careful passing Obj-C objects
through void* pointers. See "Managing Opaque Pointers" here:
<http://developer.apple.com/mac/library/documentation/cocoa/conceptual/
GarbageCollection/Articles/gcUsing.html>
If you can require 10.6, I believe the new block APIs make the memory
management simpler (haven't tried myself).
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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