Re: out of bounds exception
Re: out of bounds exception
- Subject: Re: out of bounds exception
- From: Frederick Cheung <email@hidden>
- Date: Tue, 8 Feb 2005 11:52:40 +0000
On 8 Feb 2005, at 11:01, Daniel Child wrote:
Thanks again to previous senders correcting my stupid newbie array
error.
Now I am getting an out of bounds exception I can't account for. The
error reads:
Do an NSLog on threeSyllables after it has been created. None of us can
guess what's in it.
[snip]
Syllable *theSyllable = [Syllable alloc];
[snip]
[theSyllable initWithPinyin: [threeSyllables objectAtIndex: 2]
bopomofo: [threeSyllables objectAtIndex: 1]
wadegiles: [threeSyllables objectAtIndex: 0]];
if (theSyllable != nil) {
[syllables addObject: theSyllable];
[theSyllable release];
}
Don't do this. You are allocing once, so there is only really one
instance of theSyllable.
you want theSyllable=[[Syllable alloc]init...];
Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden