I try to convert NSString to int,Result dpPoint:0, I want dpPoint:2
dpPointStr = [NSString stringWithFormat:@"%@",[verifyRow valueForKey:@"default_point"]];
NSLog(@"dpPointStr:%@",dpPointStr); //Result dpPointStr:2
int dpPoint = [dpPointStr intValue];
NSLog(@"dpPoint:%i",dpPoint); //Result dpPoint:0
In your case, if value is in the beginning/end of the string you can try this: