leah / PullToRefresh

A simple iPhone TableViewController for adding pull-to-refresh functionality.
http://blog.leahculver.com/2010/07/iphone-pull-to-refresh.html
MIT License
1.91k stars 252 forks source link

Despite of updating is finished, 'Loading...' is still running #29

Closed hardreggaecafe closed 11 years ago

hardreggaecafe commented 11 years ago

Hello

I implemented PulltoRefresh. And when I tested on my TableViewController, indicator shows properly at first. But despite of updating is finished, 'Loading...' is still running...

What's the matter with my app?

Please let me know how to fix it.

Regards Noriaki

iprebeg commented 11 years ago

Hi Noriaki!

You probably have to call stopLoading: selector after updating either failed or finished

hardreggaecafe commented 11 years ago

Absolutely!

I didn't write below line.

[self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0];

Thanks for your advice.

iprebeg commented 11 years ago

I'm not sure what you actually load but here you are assumimg that loading takes exactly 2 sec, which is probably wrong. Better way to do it is calling this selector with no delay on event that signalizes that loading is done or failed, e.g. connection:didFinishLoading or connection:didFailWithError: