I have problem with a NSArray
object that a json
service create it.
in my NSArray
object there is just one object and it is a number.
when i debug code and watch NSArray
Value with mouse over it show numbers in this format:@""1""
.
when i want to convert it to int or NSNumber
it return 0
. i checked it with a lot of approach.
and when I want to convert it to NSString
and show string
using NSLog
or watch tool it will show it like "1".
these are some code of my efforts:
data
is a NSArray
Object:
NSString *str = [data objectAtIndex:0];
NSNumber *number = [str integerValue];
int int1 =[[str stringByReplacingOccurrencesOfString:@"""" withString:@""] intValue];
number = [data objectAtIndex:0];
number = [[data objectAtIndex:0] integerValue];