I get a Data argument not used by format string
error when I run the following code:
- (void)pickerView:(UIPickerView *)thePickerView didSelectR
NSLog(@"NSString = ", colour);
NSLog(@"NSUserDefaults =", [defaults objectForKey:@"colour"]);
Is problematic
Should be
NSLog(@"NSString = %@", colour);
NSLog(@"NSUserDefaults = %@", [defaults objectForKey:@"colour"]);
The format specifier in this case is the %@
which is used to print an object
. To print numbers you'd use something like %d
. See complete documentation here.