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 trialAdam Berkowitz
2,673 PointsTwo 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?
Adam Berkowitz
2,673 PointsWell 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.
Soojin Ro
13,331 PointsSoojin Ro
13,331 Pointsyou should post screenshots or some code..