Re: Storing C objects (structs) in NS Containers?
Re: Storing C objects (structs) in NS Containers?
- Subject: Re: Storing C objects (structs) in NS Containers?
- From: Tim Buchheim <email@hidden>
- Date: Mon, 12 Jul 2004 11:34:27 -0700
On Mon, 12 Jul 2004 11:17:38 -0700, Cody Garvin <email@hidden> wrote:
>
Is it possible to store C Structs in a NSContainer...
>
>
For example, I want to store NSRect into a NSMutableArray.
>
Do I have to use a normal C Array to do this? I know that when you add an
>
object to NSMutableArray it sends a retain message to the object that is
>
being added, but is there a way to force it any way?
The Cocoa container objects (NSArray, NSDictionary, etc.) only hold
Objective C objects. You can wrap arbitrary data in an NSData
instance, but if you just want an array of NSRect structs, then you're
probably better off using a standard C array. (Although you might
want to make a Cocoa object to encapsulate the array and provide an
NSArray-like interface.)
--
Tim Buchheim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.