开发者

Can i add value in Setting.bundle via .m file? [closed]

开发者 https://www.devze.com 2023-04-03 11:06 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomp开发者_如何学Pythonlete, overly broad, or rhetorical andcannot be reasonably answered in its current f
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomp开发者_如何学Pythonlete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I am working on SMS app. I want to add the registered number in the Setting.Bundle dynamically.

  1. How can I set .plist value dynamically in Setting.bundle when a user clicks on the Register button?
  2. 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"];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号