Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- { "id”:"1”,
- "subscription":"1”,
- "like”:”20”,
- "title”:"ABC”,
- "image”:"https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png?itok=Jxf0IlS4
- ”},
- { "id”:"2”,
- "subscription":"1”,
- "like":"6”,
- "title”:"XYZ”,
- "image”:"https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png?itok=Jxf0IlS4
- ”}, { "id”:"3”,
- "subscription":"1”,
- "like”:"12”,
- "title”:"you”,
- "image”:"https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png?itok=Jxf0IlS4
- ”},
- ]
- - (void)viewDidLoad
- {
- NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
- NSString *currentLevelKey = @"PhotoId";
- if ([preferences objectForKey:currentLevelKey] == _Photo_Id)
- {
- [like setHidden:NO];
- }
- else
- {
- //Dis_like.hidden=YES;
- }
- }
- - (IBAction)Like_Button:(id)sender
- {
- like.hidden=YES;
- Dis_like.hidden=NO;
- }
- - (IBAction)Dis_like_Button:(id)sender
- {
- Dis_like.hidden=YES;
- like.hidden=NO;
- NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
- NSString *currentLevelKey = @"PhotoId";
- Str_Photo_id =_Photo_Id;
- [preferences setValue:Str_Photo_id forKey:currentLevelKey];
- // Save to disk
- const BOOL didSave = [preferences synchronize];
- if (!didSave)
- {
- // Couldn't save (I've never seen this happen in real world testing)
- }
- else
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement