我正在进行一些练习,并得到一个警告:
隐式转换失去整数精度'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;
}
Run Code Online (Sandbox Code Playgroud)
