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

iOS Build a Self-Destructing Message iPhone App Relating Users in Parse.com Removing Friends by Tapping on a Table View Cell

Challenge 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
Holger Liesegang
50,595 Points

Hi Vikram,

the question states "don't worry about using any blocks" so this should suffice:

    [self.playlist saveInBackground];

Kind Regards Holger

Patrick Donahue
Patrick Donahue
9,523 Points

It says you don't have to worry about using a block. [self.playlist saveInBackground];

Patrick Donahue
Patrick Donahue
9,523 Points

HAHA - I guess I refreshed at the right time!

Thank you guys! Very much appreciated!