bennyguitar / libHN

The definitive Objective-C library for adding HackerNews to your iOS/Mac app.
MIT License
150 stars 26 forks source link

loadPostsWithUrlAddition:[[HNManager sharedManager] postUrlAddition] , posts is never nil #5

Closed auto234875 closed 10 years ago

auto234875 commented 10 years ago

I don't know if this is intentional, so my apology if it is not an issue. Just something I've noticed.

[[HNManager sharedManager] loadPostsWithUrlAddition:[[HNManager sharedManager] postUrlAddition] completion:^(NSArray *posts) { if (posts) {} else{}

The else condition never gets trigger. Instead, I had to an another if condition inside if (posts) { if ([posts count]==0) {}}

to keep it from slamming the server.

bennyguitar commented 10 years ago

Yes I had to do the same thing in my app as well. Maybe I should have made that more clear in the README. I'll make an addition, and then maybe test ways to see if that's nil or not anymore.