我得到一個Data argument not used by format string
錯誤,當我運行下面的代碼:IOS編程 - 數據的說法不使用的格式字符串
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
NSString *colour = ([colourArray objectAtIndex:row]);
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:(colour) forKey:@"colour"];
NSLog(@"NSString =", colour);
NSLog(@"NSUserDefaults =", [defaults objectForKey:@"colour"]);
}
我得到兩個NSLog
線的錯誤。另外,這裏是日誌說什麼:
2011-10-25 09:01:50.260 Random[35636:b303] NSString =
2011-10-25 09:01:50.260 Random[35636:b303] NSUserDefaults =
謝謝 亞瑟
非常感謝,它解決了問題! – gadgetmo