NSMutableArray initWithCapacity and insertObject:atIndex
NSMutableArray initWithCapacity and insertObject:atIndex
- Subject: NSMutableArray initWithCapacity and insertObject:atIndex
- From: Adam Gerson <email@hidden>
- Date: Mon, 10 Aug 2009 00:59:05 -0400
I would like to insert objects out of order into an NSMutableArray.
I create the array with
NSMutableArray* cards = [[NSMutableArray alloc] initWithCapacity:5];
When I try to call
[cards insertObject:card atIndex:4];
I get the error:
*** -[NSCFArray insertObject:atIndex:]: index (4) beyond bounds (1)
Why doesn't this work?
Thanks,
Adam
_______________________________________________
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