The solution is:
if ([parsedValue isKindOfClass [NSNumber class]] &&
strcmp([parsedValue objCType], @encode(char)) == 0) {
// parsedValue is converted from 'true' or 'false' in JSON.
}
One weird thing is NSJSONSerielization
sets objCType
of a boolean value to @encode(char)
instead of @encode(BOOL)
.