• 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
Re: out of bounds exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >out of bounds exception (From: Daniel Child <email@hidden>)

  • Prev by Date: Creating NSImage from multiple images while dragging
  • Next by Date: Re: Code-insight in NSTextview
  • Previous by thread: out of bounds exception
  • Next by thread: Creating NSImage from multiple images while dragging
  • Index(es):
    • Date
    • Thread