On Sat, Dec 20, 2008 at 7:00 AM, Clark S. Cox III <clarkc...@gmail.com> wrote:
> The objective-c garbage collector does not move objects, so that is not an
> issue with using raw pointers.

But note that storing a pointer value in a string like this is still
problematic under garbage collection. It will not act like a strong
reference, so the object may be destroyed while still being
"referenced" by the string. But it will not act like a zeroing weak
reference either, so you'll still be able to get the pointer even
after it's been destroyed, which will (probably) lead to a crash.

An NSMapTable can be configured to give either reasonable behavior
(strong or zeroing weak reference) so use that instead.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to