我想在保存数据后,分别在文本字段中选择第一个选择器项目,在选择器中保留3个项目。我不知道如何编写代码来保存appdelegate类中的数据 -
(void)applicationDidEnterBackground:(UIApplication *)application{}
答案 0 :(得分:0)
hi just check this link you will find the demo example their. [Click Here][1]
[1]: http://www.roseindia.net/tutorial/iphone/examples/UIPickerView/UIPickerViewExample.html
and for the store data in appdelegate //
in .h
@interface Hiar_Style_NewAppDelegate :
{
NSString *strselect;
}
@property(nonatomic,retain)NSString *strselect;
in .m
@synthesize strselect;
and whenever you want to use it just make delegate of app deegate file like this
Hiar_Style_NewAppDelegate *objappdel=(Hiar_Style_NewAppDelegate *)[[UIApplication sharedApplication]delegate];
and use that object like this
objappdel.strselect=@"";