Re: array with int
Re: array with int
- Subject: Re: array with int
- From: Hua Ying Ling <email@hidden>
- Date: Wed, 10 Mar 2004 08:50:35 -0500
On Mar 10, 2004, at 8:30 AM, j o a r wrote:
Easy! Integer values are not objects. You can only add Objective-C
objects conforming to the NSObject protocol to Cocoa collections.
j o a r
On 2004-03-10, at 14.20, Sascha Kuehn wrote:
can someone tell me why this not work??
------------------------------------------------------
NSMutableArray *temp = [[NSMutableArray array] retain];
[temp addObject:0];
------------------------------------------------------
You could try using this instead:
// to add
[temp addObject:[NSNumber numberWithInt:0]];
// to read
int tempInt = [[temp objectAtIndex: someIndex] intValue];
~Hua Ying
_______________________________________________
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.