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 trialLudwing Najera
4,596 PointsIOS7 different coding format than IOS6?
there was a chunk of code that i had to write into my app which, in the video, said it was auto generated and maybe i messed up a line of code and nothing is showing up on the ViewController.
here is the code that i had to write:
-
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [self.titles objectAtIndex:indexPath.row];
return cell; }
4 Answers
Stone Preston
42,016 Pointsin XCode 5 xcode does not generate the cellForRowAtIndexPath method for you. you have to write it yourself. its normal
Ludwing Najera
4,596 Pointsoh, but why is the objects on the array not showing up on the ViewController?
Stone Preston
42,016 Pointscan you explain a little more what you mean by that?
Ludwing Najera
4,596 Pointsthe array:
self.titles = [NSArray arrayWithObjects:@"Getting started with WordPress", @"Whitespace in Web Design: What It Is and Why You Should Use It",
@"Adaptive Images and Responsive SVGs - Treehouse Show Episode 15",
@"Productivity is About Constraints and Concentration",
@"A Guide to Becoming the Smartest Developer on the Planet",
@"Teacher Spotlight: Zac Gordon",
@"Do You Love What You Do?",
@"Applying Normalize.css Reset - Quick Tip",
@"How I Wrote a Book in 3 Days",
@"Responsive Techniques, JavaScript MVC Frameworks, Firefox 16 | Treehouse Show Episode 14", nil];
Ludwing Najera
4,596 Pointsthe view controller is blank and i think that the chunk of code i wrote is the heart of it all.
Stone Preston
42,016 Pointsis your viewController inheriting from UITableVIewController?