Can i add value in Setting.bundle via .m file? [closed]
I am working on SMS app. I want to add the registered number in the Setting.Bundle dynamically.
- How can I set .plist value dynamically in Setting.bundle when a user clicks on the Register button?
- How do I add a number in Settings.bundle?
I don't understand how to get a value on a click event and then show that in Setting.bundle dynamically. For example, while a user registers in app I want to show his/her number in setting of my application.
Why not use NSUserDefaults
?
NSNumber *yourvalue = [NSNumber numberWithInteger:1];
[[NSUserDefaults standardUserDefaults] setObject:yourvalue forKey:@"yourkey"];
[[NSUserDefaults standardUserDefaults] synchronize];
Then get it from defaults like that:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *value = [defaults objectForKey:@"yourkey"];
精彩评论