• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
seg fault quandry
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: seg fault quandry
      • From: Ondra Cada <email@hidden>
    • Re: seg fault quandry
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Controller introspection API
  • Next by Date: Is there a bug in #include operation?
  • Previous by thread: Re: Delete row from NSTableView
  • Next by thread: Re: seg fault quandry
  • Index(es):
    • Date
    • Thread