I recently submitted a bug report to Apple about this, but I thought I would ask the question anyways in case I'm missing something obvious. In Objective-C, the following call works fine on a 64-bit system but throws an NSInvalidArgumentException on a 32-bit system:
[self setValue:@"true" forKey:@"flag"];
The "flag" property is a BOOL:
@property BOOL flag;
Further, the call works fine in Swift/32-bit, where the property is a Bool:
var flag: Bool = false
Similarly, this call works fine in Swift on a 64-bit system but throws NSInvalidArgumentException on the 32-bit system ("index" is an Int):
setValue("2", forKey: "index")
Yet it works fine in Objective-C/32-bit, where the property is an NSInteger.
I would have expected these calls to work correctly regardless of language or processor architecture. Does anyone have any insight into why they might not?