Re: Strings
Re: Strings
- Subject: Re: Strings
- From: Ben Jansen <email@hidden>
- Date: Tue, 12 Feb 2002 23:23:01 -0800
On Tuesday, February 12, 2002, at 10:37 PM, email@hidden wrote:
OR, you could do it all in Objective-C, like this, and avoid all the
fixed-sized character buffers above - and their potential for buffer
overruns if someone enters too much text.
NSString *inValue = [inputField stringValue];
NSArray *ta = [inValue componentsSeparatedByString: @" "]];
NSString *outValue = [ta componentsJoinedByString: @"\n"]
[parsedField insertText: outValue];
Not to mention that this way you're Unicode-safe.
C strings are bad. NSString is gooood.
Perhaps, but std::string is better ;-P I suppose whether or not you like
ASCII makes a difference, though.
Actually, through my cursory looks at the documentation, most of the
ObjC 'helper' classes are slightly under par compared to the C++ STL and
Standard Library classes, in terms of overall functionality. I usually
end up using C++ classes for the actual guts, and ObjC for the
interface/controller.
- Ben
Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.