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 Adding Recipients

cameraViewController.m - return number of rows in section.

The error message i am getting is as follows - No visible @interface for 'NSString' declares the variable 'count'

// Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    // Return the number of rows in the section.
    return [self.friends count];          <---- *ERROR LINE*

}

Ok i seem to have solve it in interface by declaring friends as an NSArray.

cameraViewController.h

@property (nonatomic, strong) UIImagePickerController *imagePicker;
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, strong) NSString *videoFilePath;
@property (nonatomic, strong) NSArray *friends;  -------> Was NSString *friends;
@property (nonatomic, strong) PFRelation *friendsRelation;

2 Answers

Richard Lu
Richard Lu
20,185 Points

I think your self.friends property is set to a NSString object which does not contain a count method. Maybe you can try NSArray. Happy Coding!

Yes just done that Richard thanks.

..