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 Diary App Using Core Data Custom UITableViewCell Custom UITableViewCell with Dynamic Height

Adam Berkowitz
Adam Berkowitz
2,673 Points

Two strange problems after customizing cell height.

I just finished working step by step through the UITableViewCell with dynamic height video and have two problems that I don't understand when I run the simulator.

1 - Every time I create a new entry in the diary, the simulator creates two entries instead.

2 - The text for the labels (e.g. Body Label) are still present in the entry.

I'm doing this in XCode 6 so maybe there's something different.

Does anyone know how to fix these issues?

Soojin Ro
Soojin Ro
13,331 Points

you should post screenshots or some code..

Adam Berkowitz
Adam Berkowitz
2,673 Points

Well it's just the code that Ash uses in the video. So it appears that there are two methods that are causing the problem.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *cellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier  forIndexPath:indexPath];

    DiaryEntry *entry = [self.fetchedResultsController objectAtIndexPath:indexPath];
    [cell configureCellForEntry:entry];
    //cell.textLabel.text = entry.body;

    NSLog(@"%@", entry);
    return cell;
}

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    DiaryEntry *entry = [self.fetchedResultsController objectAtIndexPath:indexPath];
    NSLog(@"%@", entry);
    return [EntryCell heightForEntry:entry];
}

Plus for some reason right now I'm also getting a "No visible @interface" error for configureCellForEntry"!

I'm pretty close to scrapping everything and starting over.