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 Blog Reader iPhone App Rebuilding from Scratch Starting Over

iOS 7 problems blog reader app, webview wont open

Hi guys,

I build and completed the blog reader tutorials using iOS 7. I ve implemented like in tutorials, but what I now see is in the app, just 10 thumbnails , title, name, date.

when i click on one blog, the webview wont open.

and i cant scroll more down to download more more blogs....

3 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

At what stage are you? In the starting over video you basically start over from scratch so if you keep going you will see how to transition from the table view controller to the detail view controller.

Mark Rabo
Mark Rabo
6,260 Points

We may be having the same issue. From the Navigation Controller lesson onwards, my project compiles and runs but selecting a cell causes it to crash. It sends the following message which points to setBlogPostURL but I've checked it over and it's what's in the videos.

What could it be?

2014-08-29 15:51:21.377 BlogReaderFromScratch[10454:60b] Preparing for segue: showBlogPost

2014-08-29 15:51:21.378 BlogReaderFromScratch[10454:60b] -[UINavigationController setBlogPostURL:]: unrecognized selector sent to instance 0x10c114f90

2014-08-29 15:51:21.389 BlogReaderFromScratch[10454:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController setBlogPostURL:]: unrecognized selector sent to instance 0x10c114f90'

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

The problem has nothing to do with iOS 7. When you are using a navigation controller the destinationController in your segue is not detail view controller. From the error you posted above it seems like you are trying to set the blogPostURL on the wrong view controller.

Mark Rabo
Mark Rabo
6,260 Points

Makes sense, this wouldn't be different in iOS7.

I did an NSLog on segue.destinationViewController and got UINavigationController: 0x109547700 which I see is also shown in the error message.

Is that the right destinationViewController? If not, what should it be and how do I specify a different one?

This is the code I'm using for the segue (identical to what's in the lesson)... stumped.

if ( [segue.identifier isEqualToString:@"showBlogPost"] ) {
        NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
        MCRBlogPost *blogPost = [self.blogPosts objectAtIndex:indexPath.row];
        [segue.destinationViewController setBlogPostURL:blogPost.url];
}
Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

The problem does not seem with your code but how you have laid out your storyboard. It seems that you might have another navigation controller between your table view controller and web view controller.

You storyboard should like this:

Mark Rabo
Mark Rabo
6,260 Points

The order is the same but the symbols between look different. picture

The Inspector between the Navigation Controller and Table View Controller looks like this: picture

And the segue Inspector like this: picture