How to convert a NSString to integer?
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