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
Bradley White
21,285 PointsDiary App Body label height issue
If I type a long enough sentence into my, my text truncates regardless what happens. I also have to go into the attributes inspector and set Lines to 0. You didn't do that in the video but that's the only way I can get it NOT to truncate. I tried setting the bottomMargin to 500 as a simple test and it still doesn't fill in the entire text. I also notice that the text of the body language is quite a distance from the date label. If I knew how, I'd send you my project files. I followed your videos 3 times in this regards and IM STUCK!
3 Answers
Patrick Serrano
13,834 PointsI noticed that they skipped over setting the lines to 0 in the attributes inspector. I just set it to 0 and moved on since it worked as expected. What issue are you running into after changing the lines to 0?
Bradley White
21,285 PointsAfter finishing the whole tutorial, I now have a couple issues.
The mood image view is always set to happy. I've tried playing around with the code in many ways to manipulate the moodImageView but it always stays the same. I went into updateDiaryEntry and insertDiaryEntry and tried setting self.entry.mood to self.pickedMood. When I NSLog self.pickedMood under the badButttonWasPressed, average, and good buttons, self.pickedImage always logs out as 0 when any button is pressed.
In the video, when Ash selects a diary entry, the picture is still on the image selection button. Every time I load I try it, the icn_noimage image is used as the button image.
UPDATE---did not type _pickedMood = pickedMood in the setter method. Still trying to figure out #2 issue.
Bradley White
21,285 PointsFor my second issue, here is my solution
In updateDiaryEntry, I changed:
self.entry.imageData = UIImageJPEGRepresentation(self.pickedImage, 0.75);
to
if (self.pickedImage != nil) self.entry.imageData = UIImageJPEGRepresentation(self.pickedImage, 0.75);
Because the EntryViewController's imageButton is setup in the storyboard with "icn_noimage", inn viewDidLoad for EntryViewController, I added this to the in the != nil check section:
[self.imageButton setImage:[UIImage imageWithData:self.entry.imageData] forState:UIControlStateNormal];
and in the else section of that check, I added:
[self.imageButton setImage:[UIImage imageNamed:@"icn_noimage"] forState:UIControlStateNormal];
I think that is all.
Taylor Mahony
5,814 PointsTaylor Mahony
5,814 PointsWow.. Thank you for this bit of insight. I just spent the last hour review the video trying to see what I missed. I'm glad to know it was just skipped. Now I know I'm not going nuts. Thanks!