In the following code for parsing a JSON, when objects happen to be other than NSArray or NSDictionary, NSJSONReadingAllowFragments is used.
The below code works fine and prints out 32. but if replace 32 by abcd, it outputs to null. Any idea why its null for a string abcd.
NSString *num=@"32";
NSError *error;
NSData *createdData = [num dataUsingEncoding:NSUTF8StringEncoding];
id response=[NSJSONSerialization JSONObjectWithData:createdData options:NSJSONReadingAllowFragments error:&error];
NSLog(@"Response= %@",response);