我正在做一些练习,并收到一条警告,指出:
隐式转换失去整数精度:“NSUInteger”(又名“unsigned long”)到“int”
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
NSArray *myColors;
int i;
int count;
myColors = @[@"Red", @"Green", @"Blue", @"Yellow"];
count = myColors.count; // <<< issue warning here
for (i = 0; i < count; i++)
NSLog (@"Element %i = %@", i, [myColors objectAtIndex: i]);
}
return 0;
}