Re: Strings
Re: Strings
- Subject: Re: Strings
- From: email@hidden
- Date: Tue, 12 Feb 2002 22:37:28 -0800
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.
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.