I've been working on an iOS project for some time now, and I've recently decided to port the code to a Mac project. Because I've chosen to use NSInteger in my code, and NSInteger is a environment-dependent typecast, it means that my variables are different types on the iOS and Mac apps.
When I run the test suite on the Mac, all my STAssertEquals calls fail with the error "Type mismatch --" because the types don't match:
NSInteger foo = 1;
STAssertEquals(foo, 1, nil); // Test fails!!
Typecasting my scalars seems to work, but this seems really messy:
NSInteger foo = 1;
STAssertEquals(foo, (NSInteger)1, nil); // Succeeds, but is ugly!!
Am I missing something here? I'm starting to suspect that the decision to use NSIntegers was a poor choice.
Update: Perhaps this article is related. It seems to support typecasting scalars.