Re: checking for line ending types
Re: checking for line ending types
- Subject: Re: checking for line ending types
- From: Andrew Farmer <email@hidden>
- Date: Sat, 27 Nov 2004 17:03:08 -0800
On 27 Nov 2004, at 15:40, Andrew Merenbach wrote:
Good day, Hunter. Your code looks fine, but you should note that the
method -[NSString cString] will, according too Apple's NSString class
docs, be 'deprecated in the near future.' They instead recommend that
one use 'UTF8String to convert arbitrary NSStrings to a lossless 8-bit
representation.'
Except that if your input isn't UTF-8, -[NSString UTF8String] may give
you screwed-up results. -[NSString cString] has its place.
On the other hand, you might not have to deal with C strings at all.
If you read the data file into an NSString, you can use -[NSString
rangeOfString:], as follows, as well as using an enumeration instead
of checking for chars:
<snip>
Looks good to me.
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden