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 Capturing Photo and Video Using UIImagePickerController Uploading the File and Message

Martin Mägi
Martin Mägi
8,295 Points

Parse PFFile documentation change

Parse PFFile documentation has changed: https://parse.com/docs/ios_guide#files/iOS

To avoid getting arrays for all database table columns, you should change this:

PFObject *message = [PFObject objectWithClassName:@"Messages"];
[message addObject:file forKey:@"file"];
[message addObject:fileType forKey:@"fileType"];
[message addObject:self.recipients forKey:@"recipientsIds"];
[message addObject:[[PFUser currentUser] objectId] forKey:@"senderId"];
[message addObject:[[PFUser currentUser] username] forKey:@"senderName"];

to this:

PFObject *message = [PFObject objectWithClassName:@"Messages"];
message[@"file"] = file;
message[@"fileType"] = fileType;
message[@"recipientsIds"] = self.recipients;
message[@"senderId"] = [[PFUser currentUser]objectId];
message[@"senderName"] = [[PFUser currentUser]username];

Make sure to delete the class "Messages" in Parse.com after changing your code to avoid getting an error in the app.

Worked for me :)

1 Answer

Martin, here is a full template for the social network application: Click Here.