- wxString resultAsWxString = wxEmptyString;
- NSString* className = NSStringFromClass([result class]);
- if ([className isEqualToString:@"NSCFNumber"])
- resultAsString = [NSString stringWithFormat:@"%@", result];
- else if ([className isEqualToString:@"NSCFString"])
- resultAsString = result;
- else if ([className isEqualToString:@"NSCFBoolean"]){
- if ([result boolValue])
- resultAsString = @"true";
+ if ([result isKindOfClass:[NSNumber class]]){
+ // __NSCFBoolean is a subclass of NSNumber
+ if (strcmp([result objCType], @encode(BOOL)) == 0){
+ if ([result boolValue])
+ resultAsString = @"true";
+ else
+ resultAsString = @"false";
+ }