I am new to iOS programming.
I am getting an "Incompatible integer to pointer conversion sending 'int' to parameter of type 'NSString *'" error when I try and run the following code:
- (IBAction)oneToSix {
int rNumber = arc4random() % 6;
[result setImage:[UIImage imageNamed: rNumber]];
}
You need to convert the
intto aNSStringbefore sending it to theimageNamedmethod. This is becauseimageNamedtakes aNSStringas the argument and not anint. Try this:More info here: UIImage Class Reference.