• 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: NSMutableString, NSString ,character for character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableString, NSString ,character for character


  • Subject: Re: NSMutableString, NSString ,character for character
  • From: Markus Hitter <email@hidden>
  • Date: Fri, 13 Jul 2001 13:06:22 +0200

Am Freitag, 13. Juli 2001 um 03:23 schrieb Michel Haver:

Question:

If you try to do something hard like writing your first cocoa application,
some simple C stuff becomes mind boggling in cocoa

Maybe it's easier than you think if you're used to use microsteps in plain C ;-)

, so here is my question:

NSString * drawString;

drawString = @"test";

How do I get the characters t e s t in this NSString?

You can always convert an NSString to an plain C-string:

char *newString = [drawString cString];

However, you should try to avoid using plain C strings. NSStrings can hold more than just single-byte characters. These additions are lost when doing the conversion.

There are a big bunch of operations for all common tasks on strings, you find most of them at the Foundation/NSString and Foundation/NSScanner documentation.


Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/


References: 
 >NSMutableString, NSString ,character for character (From: Michel Haver <email@hidden>)

  • Prev by Date: security framework and access()
  • Next by Date: Re: security framework and access()
  • Previous by thread: Re: NSMutableString, NSString ,character for character
  • Next by thread: Re: NSMutableString, NSString ,character for character
  • Index(es):
    • Date
    • Thread