Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS

Keith Forsythe
Keith Forsythe
6,316 Points

Blog Reader App (iOS7)

I'm working through the blog reader app in Xcode 5 and I noticed the author subtitles are not displaying. When I run the application it compiles and runs fine - just no subtitles. Is this a change in iOS 7 or do I suck? Here is the code I am using;

cell.textLabel.text = [blogPost valueForKey:@"title"];
cell.detailTextLabel.text = [blogPost valueForKey:@"author"];

3 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Check the style of the table view cell in the storyboard. It should say "Subtitle".

Keith Forsythe
Keith Forsythe
6,316 Points

Yep, that was the problem. Thanks for the help and thanks for the great teaching!

Hello, I am having a problem with this code. I have the exact same code as Keith shows above (and also as shown in the video), but I am getting the error "Assignment to readonly property" on the detailTextLabel line. I have changed the table view cell in the storyboard to "Subtitle" as well.

The program compiles and runs fine with only the textLabel line, but the addition of the detailTextLabel line seems to break it.

I can't seem to figure it out.....any help would be appreciated!

Update ---> I rewatched the video and started over, realized the code wasn't exact after all. Was missing the .text statement after detailTextLabel.