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

I guess my blog reader is not working properly.

I wonder if anyone who run the application on a device encountered such issue. Scrolling is not smooth, it behaves in a very unpleasant way for a user. here is a video i made to show you how it the issue look like: https://www.youtube.com/watch?v=VmJq_Cw6PYo&feature=youtu.be

10 Answers

I found it. On the TableViewController.M Line 92

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];


    BlogPost *blogPost = [self.blogPosts objectAtIndex:indexPath.row];

    if ([blogPost.thumbnail isKindOfClass:[NSString class]]) {


    NSData *imageData = [NSData dataWithContentsOfURL:blogPost.thumbnailURL];
    UIImage *image =[UIImage imageWithData:imageData];

    cell.imageView.image = image;
    } else { // HERE LINE 92
        cell.imageView.image = [UIImage imageNamed:@"badges7.png"];
    }
    cell.textLabel.text = blogPost.title;
    cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ - %@",blogPost.author,[blogPost formattedDate]];
    return cell;

}

//Be sure to finish the If and else statement Its line 92 in your code. 

Hi Dawid, can you share some of the code with us?

any specific class or upload screens of whole code?

Can you put it on Github or dropbox? That way we can see all the code and figure out what is causing the slow scrolling. Are you using JSON or XML?

Yes I did it in excactly same way as it was shown on videos. So, i use JSON https://www.dropbox.com/sh/onk46gztwf8wpqn/AABZyTm2gRevEKZbRdY04Rh7a

I'll Take a look now.

Thank you so much! However, I cannot test if it works right now because now Xcode doesn't see my iphone connected...

Relaunch Xcode and re-connect your phone.

OK i got it on my phone, now it has the missing treehouse icon near the post, but scrolling is still slow and not smooth… moreover, I downloaded project from the course and it looks really bad, why is it so? http://imgur.com/mkjp5M6 Meanwhile, could you quickly take a look here? https://teamtreehouse.com/forum/something-is-wrong-with-loginviewcontroller

What size iPhone do you have? Also, it looks like you download the unfinished project. Try downloading the last one.

Ok, nevermind. Aaron, when you had fixed the incomplete if statement, evething worked fine on your simulator/device? Did you notice progression of scrolling? Could you upload modified project on dropbox, so I can download it and check if it works on my device?

I tested the app via the simulator. I'll post it on github for you to download.

https://github.com/Mav3r1ck/BlogReader_DC

Scrolling now is a bit smoother but again I notice moments when it lags, in your simulator everything works perfectly fine? thank you

It does, When I get home later I'll upload it onto the my phone and see If I have any issues.

thank you, looking forward for the result of your experiment:)

thank you, looking forward for the result of your experiment:)

Yeah its a bit choppy on the phone. very odd.

That's a relief that I'm not alone :) Did you finish this project on your own before? Did you encounter such issues?

I have.. Its on my Github profile and it works fine for me. Check it out here:

https://github.com/Mav3r1ck/Mav_BlogReader