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 Customizing Table View Cell Appearance

Mathieu Grenier
PLUS
Mathieu Grenier
Courses Plus Student 8,997 Points

Under Xcode6, i have same code and don't get right height for some labels! Any1 have same problem ?

If my row height is 105, and tableview display wrong and position "body label" and "location label" in "Entry Cell" and "location label" positioned around (x.y) (100, 240) over the second cell for only this text @"sss"!

(i disabled auto-layout)

Strangely, i download the sample code and compiled and don't get this problem ... hum somewhere in Xcode6 i missed something and what ?

https://www.dropbox.com/s/qql1thd05u8o60u/IMG_1339.PNG?dl=0

Josh Holton
Josh Holton
7,403 Points

I have spent hours trying to solve this same problem! I've re-watched the videos and made sure my code is exactly the same. Is it the fact that I'm building the project for a later version of iOS (8.1) or using a later version of xcode (6.1)????

2 Answers

Luis Garcia
Luis Garcia
3,359 Points

I just got the label to display multiple lines without having to do anything with auto-layout. If you select your bodyLabel and then within the attributes inspector you set the 'Lines' option to 0, it automatically figures out how many lines it needs!

Thanks!

Mathieu Grenier
PLUS
Mathieu Grenier
Courses Plus Student 8,997 Points

yes, Xcode6 + iOS 8.1. Finally, i solved with auto-layout , i have not choice ... !

Josh Holton
Josh Holton
7,403 Points

Ha ditto! I gave up and used auto-layout and added contraints on the labels. Nice waste of 4 hours today! :) Thx for reply.

Luis Garcia
Luis Garcia
3,359 Points

I ran into the same problem! Could you give me a hint as to how you used auto-layout to get it to work? Thank you!