Re: Needed : set class for Cocoa
Re: Needed : set class for Cocoa
- Subject: Re: Needed : set class for Cocoa
- From: "Sean McBride" <email@hidden>
- Date: Fri, 6 Feb 2009 11:47:59 -0500
- Organization: Rogue Research Inc.
On 2/5/09 7:57 PM, Adam R. Maxwell said:
>>> I have decided to do an implementation myself, as an objective c++
>>> wrapper to
>>> std::set<id>. I want to use the class to aid in destruction of
>>> directed cyclical object graphs,
>>> in dual mode frameworks.
>>
>> "Dual mode" as in both Retain-Release and Garbage Collection? If
>> so, be
>> careful. I don't think an std::set will keep strong references to the
>> Obj-C objects it contains. You may need to CFRetain()/CFRelease()
>> your
>> objects manually.
>
>You could just use CFSetCreateMutable with NULL retain/hash callback
>functions and CFRetain/CFRelease ownership.
That would probably work well for the OP. He wouldn't need C++ and it
would probably work with with RR and GC.
>The nice part is that it
>can then be cast to an NSMutableSet.
Are you sure? I thought toll-free bridging only worked if you don't use
custom CF callbacks. IAC, I don't think the OP said he needed toll-free
bridging.
--
____________________________________________________________
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