Subject: Re: Reading one line at a time using NSFileHandle

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.



Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

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

Help/Unsubscribe/Update your Subscription:

This email sent to maillists@xxxxxxxxx