It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, 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
                            
                        
                    
                
                                已关闭8年。
            
                    
我正在使用SMS应用程序。我想动态地在Setting.Bundle中添加注册号。


当用户单击“注册”按钮时,如何在Setting.bundle中动态设置.plist值?
如何在Settings.bundle中添加数字?


我不明白如何在click事件上获取值,然后在Setting.bundle中动态显示该值。例如,当用户在应用程序中注册时,我想在设置应用程序时显示其号码。

最佳答案

为什么不使用NSUserDefaults

NSNumber *yourvalue = [NSNumber numberWithInteger:1];
[[NSUserDefaults standardUserDefaults] setObject:yourvalue forKey:@"yourkey"];
[[NSUserDefaults standardUserDefaults] synchronize];


然后从这样的默认值获取它:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *value = [defaults objectForKey:@"yourkey"];

07-28 03:01