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

Re: Text file


  • Subject: Re: Text file
  • From: Henrietta Read <email@hidden>
  • Date: Sun, 18 Apr 2010 00:40:22 -0700

>> The call to -stringWithContentsOfFile: looks correct, but you're failing
to check for errors. If it fails, it will return nil, and passing nil to
setString: is illegal and will throw an exception.

right, right... most correct. I can catch the nil.

>> This leaves the question of why -stringWithContentsOfFile: would fail.
I'm not sure what heuristics that call uses, but you'd think it would be
able to handle MacRoman, obsolete though it is.

exactly the point germane, but in perusing NSString.h one is given to
understand this method might not be as 'smart' as one could wish:

--
   "*These try to determine the encoding, and return the encoding which was
used.  Note that these methods might get "smarter" in subsequent releases of
the system, and use additional techniques for recognizing encodings. If nil
is returned, the optional error return indicates problem that was
encountered (for instance, file system or encoding errors).*"
--

...alas poor lost MacRoman.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Text file
      • From: Jens Alfke <email@hidden>
    • Re: Text file
      • From: Raffael Cavallaro <email@hidden>
References: 
 >Text file (From: Henrietta Read <email@hidden>)
 >Re: Text file (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Supporting different orientations with UITabBarView?
  • Next by Date: Re: Converting an afp:NSURL to a filesystem path - or - Ya can't get there from here...
  • Previous by thread: Re: Text file
  • Next by thread: Re: Text file
  • Index(es):
    • Date
    • Thread