开发者

how to store and retrieve integer value in nsuser defaults?

开发者 https://www.devze.com 2023-04-01 12:57 出处:网络
I am use the开发者_C百科 segment control and store state of segment value segment control is use for speed type set in speedometer application.Tried this?

I am use the开发者_C百科 segment control and store state of segment value segment control is use for speed type set in speedometer application.


Tried this?

[[NSUserDefaults standardUserDefaults] setInteger:yourInteger forKey:@"your key"];

And of course you can get the integer value back using:

[[NSUserDefaults standardUserDefaults] integerForKey:@"your key"];


you can use this tutorial for better understanding of NSUserdDefaults to store integer and string Value

http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk/

0

精彩评论

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