hit counter


My development logbook

Values of Type NSInteger Should Not Be Used as Format Arguments

In this example,

NSInteger val = 15000;
    NSLog(@"%i", val);

XCode will flag this error

Values of type "NSInteger" should not be used as format arguments: add an explicit cast to 'long' instead.

It is because NSInteger can be 32-bit or 64-bit, depending on the platform, the compiler recommends to add a cast to long generally.