picker in settings bundle
I'm trying to use the Settings Bundle to se开发者_如何学Got preferences for my app. Am I able to use a picker in the settings bundle? The documentation doesn't seem to indicate that I am, but the Nike + iPod app seems to use a picker for Weight. If yes can any one give some idea or any tutorial for that.
Thanks in advance
Your view controller should impliment the <UIPickerViewDelegate>
protocol
Then impliment the picker view delegates didSelectRow
method something like so:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
[[NSUserDefaults standardUserDefaults] setObject:[pickerData objectAtIndex:row] forKey:@"mySettingKey"];
//my setting is the key for your setting in the bundle which you would set inside the .plist editor
}
精彩评论