• 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: bus error (newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bus error (newbie)


  • Subject: Re: bus error (newbie)
  • From: Frederick Cheung <email@hidden>
  • Date: Tue, 8 Feb 2005 10:02:38 +0000


On 8 Feb 2005, at 09:56, Daniel Child wrote:
US ERROR OCCURS WHEN I TRY TO INIT THE OBJECT BELOW
		[theSyllable initWithPinyin: [threeSyllables[2] stringForObjectValue]
											 bopomofo: [threeSyllables[1] stringForObjectValue]
											wadegiles: [threeSyllables[0] stringForObjectValue]];
		[syllables addObject: theSyllable];
		count++;
	}

If I remove stringForObjectValue, I get a message to the effect that I am passing pointers from incompatible types (presumably because the array (threeSyllables) contains objects and I need NSStrings to meet the init requirements for theSyllable.

I know I am missing something incredibly obvious with respect to ways to convert object -> NSString, but after mucking around for a while, I still don't get it. Would appreciate the help!

2 things:
1) an NSArray is not a c array, you access values via [threeSyllables objectAtIndex:index]
2) you are initing theSyllable without having called alloc first. theSyllable is almost certainly pointing at junk or at an invalid address.


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: 
 >bus error (newbie) (From: Daniel Child <email@hidden>)

  • Prev by Date: bus error (newbie)
  • Next by Date: Re: bus error (newbie)
  • Previous by thread: bus error (newbie)
  • Next by thread: Re: bus error (newbie)
  • Index(es):
    • Date
    • Thread