seg fault quandry
seg fault quandry
- Subject: seg fault quandry
- From: pmcurry <email@hidden>
- Date: Mon, 1 Mar 2004 12:00:44 -0800
I have an NSMutableArray levelSize that I create in a function with
levelSize = [[self initLevelSize] retain];
-(NSMutableArray*)initLevelSize
{
<snip>
ma = [NSMutabableArray arrayWithCapacity:2];
n = [NSNumber numberWithInt:5];
[ma insertObject:n atIndex:0];
[n release];
n = [NSNumber numberWithInt:2];
[ma insertObject:n atIndex:1];
[n release];
return ma;
}
Later in my code I have this happening:
[levelSize count] gives 2, but
[levelSize objectAtIndex:1] gives a segmentation fault or bus error!
What am I missing?
Thanks.
-Phil
_______________________________________________
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.