• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Strings
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Strings (From: email@hidden)

  • Prev by Date: Re: C99 complience
  • Next by Date: Re: NSSliderCell private variables
  • Previous by thread: Re: Strings
  • Next by thread: Re: Strings
  • Index(es):
    • Date
    • Thread