能否请你帮忙。我有很多这样的储蓄
SaveFBProfilePicture1 = ProfilePicture1.stringValue;
DefaultProfilePicture1 = [NSUserDefaults standardUserDefaults];
[DefaultProfilePicture1 setObject:SaveFBProfilePicture1 forKey:@"SaveProfilePicture1"];
[DefaultProfilePicture1 synchronize];
SaveFBProfilePicture2 = ProfilePicture2.stringValue;
DefaultProfilePicture2 = [NSUserDefaults standardUserDefaults];
[DefaultProfilePicture2 setObject:SaveFBProfilePicture2 forKey:@"SaveProfilePicture2"];
[DefaultProfilePicture2 synchronize];
SaveFBAlbums2 = Albums2.stringValue;
DefaultAlbums2 = [NSUserDefaults standardUserDefaults];
[DefaultAlbums2 setObject:SaveFBAlbums2 forKey:@"SaveAlbums2"];
[DefaultAlbums2 synchronize];
SaveFBAbout1 = About1.stringValue;
DefaultAbout1 = [NSUserDefaults standardUserDefaults];
[DefaultAbout1 setObject:SaveFBAbout1 forKey:@"SaveAbout1"];
[DefaultAbout1 synchronize];
SaveFBAbout2 = About2.stringValue;
DefaultAbout2 = [NSUserDefaults standardUserDefaults];
[DefaultAbout2 setObject:SaveFBAbout2 forKey:@"SaveAbout2"];
[DefaultAbout2 synchronize];
而且我不知道如何为此创建功能。
我需要一个功能
- (void)SaveFB {
SaveFBxy = xy.stringValue;
Defaultxy = [NSUserDefaults standardUserDefaults];
[Defaultxy setObject:SaveFBxy forKey:@"Savexy"];
[Defaultxy synchronize];}
例如,我可以轻松地将“x”更改为“关于”或“专辑”,将“y”更改为“1”或“2”
请帮我。并提前感谢您!