Activity Indicator messing up TableView
I am loading Images from the web to put in my table view and It was working all fine, but it was taking up to ten seconds, so I decided the best thing to do would add the activity indicator. After it not working properly I did some more research and realized that I needed to thread it to get the desired effect.
Now In viewDidLoad I call
[loading startAnimating];
and
[NSThread detachNewThreadSelector:@selector(LoadIt) toTarget:self withObject:nil];
then in the LoadIt function i load all the images
and call
[self performSelectorOnMainThread:@selector(DoneIt) withObject:nil waitUntilDone:NO];
in DoneIt i call
[loading stopAnimating];
[fTable reloadData];
however i just get an empty table view.
I put break point in a bunch of places and found that i hit
numberOfSectionsInTableView
and
numberOfRowsInSection
but I never hit
cellForRowAtIndexPath
I believe this is the reason that the tableview isn't being filled out, but I have no idea why that function isn't being called. I was pretty sure that reload data was the right function, I was hoping that it would just call cellForRowAtIndexPath itself and that was how it reloaded.
I've been banging my head against this activity indicator for 3 days now and I would appreciate any help you guys could give me.
|