• 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
NSArray- help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArray- help!


  • Subject: NSArray- help!
  • From: Dave Sopchak <email@hidden>
  • Date: Sat, 2 Nov 2002 08:37:07 -0800

Hi all,

I'm having trouble accessing an NSArray I've made...the program keeps crashing with an "EXC_BAD_ACCESS" error using the debugger, or "the app has exited due to signal 10 (SIGBUS)"

The offending line, at the bottom of the code snippets:

GuideStar* currentGuide = [guideStarArray objectAtIndex: 0];

in the "guide" method.

My intention is to make an array of 3 guide objects, each object will get modified in time. If I read the docs correctly, I can use an NSArray for an "immutable" array of objects- by this I take it that the array of objects, not the objects themselves, must remain untouched (can't add or remove array objects).

of course now all I'm trying to do is get the address of one of the objects and it keeps crashing...what am I missing?

thanks for any and all...Dave



relevant code snippets:

@interface Telescope : NSObject
{
NSArray* guideStarArray;
int guideStarNum;
double scopeMat[3][3];
double ngScpMat[3][3];
double localMat[3][3];
double celesMat[3][3];
double s2cMat[3][3];
double c2sMat[3][3];
double s2LMat[3][3];
}

-(id)init;
-(void)guide:(GuideStar*)object;


////////////////////

-(id) init
{
GuideStar* guideStar1 = [[GuideStar alloc] init];
GuideStar* guideStar2 = [[GuideStar alloc] init];
GuideStar* guideStar3 = [[GuideStar alloc] init];

GuideStar* test;

if (self = [super init])
{
guideStarArray = [NSArray arrayWithObjects: guideStar1, guideStar2, guideStar3, nil];
[guideStar1 release];
[guideStar2 release];
[guideStar3 release];
}
}

-(void)guide:(GuideStar*)object
{
GuideStar* currentGuide = [guideStarArray objectAtIndex: 0];
_______________________________________________
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: NSArray- help!
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Speech Recognition / Synthesis Cocoa APIs ??? Where ?????
  • Next by Date: Re: NSArray- help!
  • Previous by thread: What's the retain-release convention in this scenario
  • Next by thread: Re: NSArray- help!
  • Index(es):
    • Date
    • Thread