Reputation: 221
In my app Web services are created in dot net and i am consuming those and I am getting response.In that all the fields like company,type,location everything are strings and there is no problem with this..And there is one more field called Exhibit number actually it is a Integer but they are created as string only.While I am displaying this it is showing zero instead of that number.. Here is my code...
//Storing into Array
[SurveyFilesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:[dic objectForKey:@"FileName"],@"FileName",[dic objectForKey:@"ExibhitNumber"],@"ExhibitNumber",[dic objectForKey:@"Description"],@"Description",[dic objectForKey:@"FileQuality"],@"FileQuality",nil]];
//Retrieving from Array..
NSLog(@"???%@???",[NSString stringWithFormat:@"%d",[[[SurveyFilesArray objectAtIndex:indexPath.row]objectForKey:@"ExibhitNumber"]intValue]]);
NSLog(@"%d",[[[SurveyFilesArray objectAtIndex:indexPath.row]objectForKey:@"ExibhitNumber"]intValue]);
Upvotes: 1
Views: 97
Reputation: 9977
You have typos in your code.
In the order of your code:
Ex-ib-hit-Number
Ex-hib-it-Number
These are 2 different strings.
In your example code you save it correctly written as Ex-hib-it
. But you try to access it with ex-ib-hit
afterwards. This cannot work.
Upvotes: 1