views:

76

answers:

2

i want to convert to convert nsstring to integer in objective-c can anybody help me in solving out this problem.

+2  A: 

NSString integerValue/intvalue This is assuming that the value is an integer, if it's not you will have more work to do, but you don't make that clear in your question.

Rulmeq
+2  A: 

try this may work for you :

NSString *str = @"42";
int x = [str intValue];
Pranay Rana
**Special Considerations**On Mac OS X v10.5 and later, use integerValue instead.
iwat