• 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: Best way to save a simple text file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to save a simple text file?


  • Subject: Re: Best way to save a simple text file?
  • From: Ali Ozer <email@hidden>
  • Date: Fri, 16 Nov 2007 10:23:10 -0800

This method has the added advantage that under Leopard it will save the encoding out, making it possible to open the file as plain text correctly in TextEdit and other apps that use NSString to open files.
Ali


On Nov 16, 2007, at 10:19 , Jean-Nicolas Jolivet wrote:

I've came across this method in the doc...

Could this be used in my NSDocument's writeToUrl method?? (So that it works with NSDocument's saving/opening/closing etc..)

If so, I think it would, indeed, be a better way!


I. Savant wrote:
However, I was wondering... is it really necessary for me to convert my
string to an NSData object before saving it? Isn't there any other way
to do it? Also, what if I would like to support multiple languages (i.e.
multiple encoding??)... right now the string is converted to UTF8...



How about NSString's -writeToURL:atomically:encoding:error: (10.4 and above only)?

--
I.S.
_______________________________________________

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


References: 
 >Best way to save a simple text file? (From: Jean-Nicolas Jolivet <email@hidden>)
 >Re: Best way to save a simple text file? (From: "I. Savant" <email@hidden>)
 >Re: Best way to save a simple text file? (From: Jean-Nicolas Jolivet <email@hidden>)

  • Prev by Date: Re: Best way to save a simple text file?
  • Next by Date: Re: Best way to save a simple text file?
  • Previous by thread: Re: Best way to save a simple text file?
  • Next by thread: Re: Best way to save a simple text file?
  • Index(es):
    • Date
    • Thread