• 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: Reading one line at a time using NSFileHandle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading one line at a time using NSFileHandle


  • Subject: Re: Reading one line at a time using NSFileHandle
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 26 Mar 2009 17:03:03 -0500

On Mar 26, 2009, at 4:48 PM, Erg Consultant wrote:

Problem with using NSString is that when it comes time to write the line out to the new file, I need an NSData and to create one, I have to use NSString's getBytes or getCharacters.

No, you should use -[NSString dataUsingEncoding:].

If you just want to create/replace a whole file from a string, use - [NSString writeToFile:atomically:encoding:error:].

Either way, you get to (have to) specify the encoding.

Regards,
Ken

_______________________________________________

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: 
 >Re: Reading one line at a time using NSFileHandle (From: Matt Neuburg <email@hidden>)
 >Re: Reading one line at a time using NSFileHandle (From: Erg Consultant <email@hidden>)
 >Re: Reading one line at a time using NSFileHandle (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Reading one line at a time using NSFileHandle (From: Erg Consultant <email@hidden>)

  • Prev by Date: Re: Reading one line at a time using NSFileHandle
  • Next by Date: Re: [Q] Strange Drag & Drop from my app to FCP project window
  • Previous by thread: Re: Reading one line at a time using NSFileHandle
  • Next by thread: Re: Reading one line at a time using NSFileHandle
  • Index(es):
    • Date
    • Thread