开发者

is there any methods like cookies in iphone

hi i am new to iphone development. i need to store a buttontag value temporarily and开发者_C百科 use it in another view is there any method to do this pls help me


Safari for iPhone supports cookies as every other browsers does. If you refer to a real objective-c coded app you might have a look at the NSUserDefauls and their related documentation in the SDK. These allow you to easily store and retrieve simple data.

Just a quick example here:

[[NSUserDefaults standardUserDefaults] setBool:saveUsername forKey:@"saveUsername"];
[[NSUserDefaults standardUserDefaults] setInteger:tabIndex forKey:@"startupTab"];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜