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 trial
Lionel Martin
3,823 PointsRibbit: Removing Friends by tapping on a Table View Cell
Hi, I am stuck in one of the step of the last code challenge of Removing Friends by tapping on a Table View Cell.
The challenge is : "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)."
While the code is : #import "FavoriteMoviesViewController.h"
@implementation FavoriteMoviesViewController
-
(void)addVideoToPlaylist:(PFObject *)video {
// Add custom code below!
PFRelation *relation = [self.playlist relationforKey: @"videos"];
[relation addObject:video];
[self.playlist saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
}]; } @end
It seems that my save method isn't working as the console returns "Compilation Error! Make sure you are sending the correct 'save' message to the 'playlist' property." and I do not really understand why as I passed the playlist through the method "saveInBackgroundWithBlock" after assigning the relation to the playlist...
Please help me !
2 Answers
Stone Preston
42,016 Pointssince it says ** (don't worry about using any blocks)** try just using the saveInBackground method
[self.playlist saveInBackground];
Lionel Martin
3,823 PointsThank You Stone for your quick answer... And you're right for the saveInBackground. However, I think that "don't worry about using blocks" should have been more explicit !
Stone Preston
42,016 PointsStone Preston
42,016 Pointscan you link the challenge