Re: Reading one line at a time using NSFileHandle
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