• 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
How to convert a NSString to integer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to convert a NSString to integer?


  • Subject: How to convert a NSString to integer?
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 23 Aug 2001 09:39:01 +0200

Yet anther stupid question. My tiny program gets an input from a text field,
is getting rid of all signs except numbers [0...9]. Now I need to do some
math with the "clean" value, but it's still a string althoug it 'looks' like
a nice integer... In C this is done by (int)value=atoi(string), but I'm not
sure how to handle this in ObjC. Seems like atoi() don't like a NSString as
argument...
Second question: How to convert a NSString to a Cstring and vice versa?

Any ideas?
Martin


References: 
 >Fun and games with Applescript "Standard Suite" in Cocoa app. (From: "Neal A. Crocker" <email@hidden>)

  • Prev by Date: Nifty Feature - Folding Functions
  • Next by Date: Re: Several sheets at the same time?
  • Previous by thread: Fun and games with Applescript "Standard Suite" in Cocoa app.
  • Next by thread: Nifty Feature - Folding Functions
  • Index(es):
    • Date
    • Thread