In JSON parse, save the parsing data into NSDictionary,
And read the key-value
like:
NSString *verCode = [JSONDict objectForKey:@\"v\"];
You can use @try{ } around code to catch exceptions.
In your case though a better approach is to look at the types of the object in the array for a key and use the right conversion as needed:
id object = [myJSONDict objectForKey:@"theValue"];
NSString *finalVal = nil;
if ( [object isKindOfClass:[NSNumber class]] )
finalVal = [object stringValue]
else
finalVal = object;