开发者

is there any methods like cookies in iphone

开发者 https://www.devze.com 2023-01-09 11:48 出处:网络
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 meSafari for iPhone supports cookies as

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

精彩评论

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