Re: Cocoa equivalent of std::vector<MyType> ?
Re: Cocoa equivalent of std::vector<MyType> ?
- Subject: Re: Cocoa equivalent of std::vector<MyType> ?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sun, 14 Dec 2008 13:45:16 +0100
Le 14 déc. 08 à 13:34, Guillaume Laurent a écrit :
Hi all,
I need to create an array of values of a specific type, and I'd
prefer to have it as a set of values rather than pointer to values
(mostly performance reasons), so not an NSMutableArray. I couldn't
find anything in Cocoa to do this, am I missing something or is it
just not a "Cocoa-ish" way of doing things ? :-)
Thx,
--
You can use a CFArrayRef.
CFMutableArrayRef myArray = CFArrayCreateMutable(kCFAllocatorDefault,
0, NULL);
Note that an array created with custom callback (null here) is not
tool-free bridgable with NSArray (base methods like retain, release
will works, but accessing the array content with NSArray methods is
not safe).
_______________________________________________
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