• 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
stringWithUTF8String: Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stringWithUTF8String: Question


  • Subject: stringWithUTF8String: Question
  • From: Karl Goiser <email@hidden>
  • Date: Tue, 6 May 2003 16:14:25 +1000

G'Day,

I am having trouble with the stringWithUTF8String: method:

I am reading data from a file - UTF data - like this:

NSData * contentsData = [NSData dataWithContentsOfFile: pathName];
if (contentsData) {
contents = [NSString stringWithUTF8String: [contentsData bytes]];
...

Intermittently, contents will return as nil. Well, actually, about 50% of the time! I can sit in ProjectBuilder, and hit command-R and sometimes this routine will work and sometimes it will fail.

This is always on the same, unchanged file which is about 700 bytes long.


Does anybody have any inkling why this might be so? It's got me!


Thanks in advance,

Karl
_______________________________________________
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: stringWithUTF8String: Question
      • From: "Clark S. Cox III" <email@hidden>
    • Re: stringWithUTF8String: Question
      • From: j o a r <email@hidden>
References: 
 >Re: Precompiled header woes (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: NSView events
  • Next by Date: Re: Hide/Show an NSView???
  • Previous by thread: Re: Precompiled header woes
  • Next by thread: Re: stringWithUTF8String: Question
  • Index(es):
    • Date
    • Thread