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 Retrieving and Viewing Data from Parse.com Retrieving Data from Parse.com

Receiving query error when Running "Retrieving and Viewing Data from Parse.com"

I am currently working on the "Retrieving Data from Parse.com" portion of the "Build a Self-Destructing Message Iphone App".

It appears that I have entered all of the code correctly. However, when attempting to run the app for the last time towards the end of the video, I receive the following data in the NS Log:

2014-07-21 23:56:37.602 Ribbit[1643:30626] CUICatalog: Invalid asset name supplied: 
2014-07-21 23:56:37.603 Ribbit[1643:30626] Could not load the "" image referenced from a nib in the bundle with identifier "com.ausarmedia.Ribbit"
2014-07-21 23:56:37.648 Ribbit[1643:30626] Current user: Candy

After inserting an exception breakpoint, it appears the app is stopping on the following line:

[query orderByDescending:@"createdAt"];

Because the error could derive from the previous line, I will post all lines related to this query:

PFQuery *query = [PFQuery queryWithClassName:@"messages"];
    [query whereKey:@"recipientIds" equalTo:[[PFUser currentUser] objectId]];
    [query orderByDescending:@"createdAt"];
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
        if (error) {
            NSLog(@"Error: %@ %@", error, [error userInfo]);
        } else {
            // We found messages!
            self.messages = objects;
            [self.tableView reloadData];
            NSLog(@"Retrieved %d messages", [self.messages count]);

Any ideas?

Thanks in advance.

Nevermind, I got it.

In this exercise there are several different accounts you should create. The account that I was using to test the query had no messages, so when the query requested to display messages in descending order, the count was "0" which threw the error. Thanks anyway!

1 Answer

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