Q:

Values of type 'NSInteger' should not be used as format argument Issue

Can someone help me with this Issue/error I'm getting on my iOS app:
Values of type 'NSInteger' should not be used as format argument; add an explicit cast to 'long' instead
My code in Viewcontroller.m (issue highlighted on first line):
    NSString *imgName = [NSString stringWithFormat:@"button%iop_on.png",b.tag];
    [b setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
    activeButton = b;
    [self performSelector:@selector(validate)withObject:nil  afterDelay:ti];

Any help would be appreciated. Thanks

A:

NSInteger can be a different size dependant on the platform you are compiling for. 
You should use the format %ld and then cast tag with (long)b.tag
NSString *imgName = [NSString stringWithFormat:@"button%ldop_on.png", (long)b.tag];

See String Programming Guide > String Format Specifiers for reference

