Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialVikram Pal
Courses Plus Student 307 PointsChallenge 3 Of 3
Usually I'm good at these challenges but lately can't figure them out. Maybe I'm tired...
Finally, we need to save these changes up to the Parse back-end. The relation is part of the 'playlist' property, where 'playlist' is an instance of PFObject. Save 'playlist' in the background to save the changes to the relation (don't worry about using any blocks).
import "FavoriteMoviesViewController.h"
@implementation FavoriteMoviesViewController
- (void)addVideoToPlaylist:(PFObject *)video { // Add custom code below! PFRelation *relation = [self.playlist relationforKey:@"videos"]; [relation addObject:video]; [self.playlist saveInBackground:^(BOOL succeeded, NSError *error){ }]; }
@end
4 Answers
Holger Liesegang
50,595 PointsHi Vikram,
the question states "don't worry about using any blocks" so this should suffice:
[self.playlist saveInBackground];
Kind Regards Holger
Patrick Donahue
9,523 PointsIt says you don't have to worry about using a block. [self.playlist saveInBackground];
Holger Liesegang
50,595 PointsYou where 2 minutes faster, Patrick Donahue :-)
Patrick Donahue
9,523 PointsHAHA - I guess I refreshed at the right time!
Vikram Pal
Courses Plus Student 307 PointsThank you guys! Very much appreciated!