in a tableView i will load data in viewDidLoad, i want to show a indicator of the activity, i've tried many roads, creating new thread ecc but i've always same problem: the activity indicator doesn't start until i move or scroll the tableview, can anyone show me how do this? Thanks everyone.
Asked
Active
Viewed 534 times
1 Answers
0
If you want to create manually the activity indicator, please refer to this tutorial.
But I strongly suggest you to investigate Three20, it is a wonderful framework that will do that for you, and much more. It makes very easy to create UITableView
s that read data from the network, you won't have to waste your time on small details (like displaying the activity indicator while you access the network) and offers many extension (like style text in table view, navigation maps, etc.).

sergio
- 68,819
- 11
- 102
- 123
-
Three20 is the main source of apps crashing after an iOS update, its a shit framework. – Antwan van Houdt May 20 '11 at 16:04
-
@Antwan van Houdt: this is not my experience working with three20, and moving from 3.1.3 to 4.0, 4.2, 4.3.2... I guess it depends on what parts of the frameworks are used... – sergio May 20 '11 at 16:08
-
Sorry but problem persist...if i don't touch/scroll the tableView the activityIndicator will not start, instead in a normal view it works. – john May 20 '11 at 16:13
-
how are you creating and displaying your UIActivitIndicator? Add some code to your question, please... – sergio May 20 '11 at 16:21
-
Here it is: UIActivityIndicator *indicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(141, 221, 37, 37)]; indicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; [self.view addSubview:indicator];indicator.hidesWhenStopped = YES; [NSThread detachNewThreadSelector:@selector(avviaClessidra) toTarget:self withObject:nil]; // Happened the same with startAnimating [indicator release]; – john May 20 '11 at 16:46
-
to start your indicator you have to execute `[indicator beginAnimating]` and to stop it `[indicator stopAnimating]`, can you explain where are you doing that? – sergio May 20 '11 at 16:59
-
The linked article looks interesting. Using Three20 sounds like SERIOUS overkill for this though. – rekle May 20 '11 at 21:51
-
right, Three20 maybe overkill... anyway, I see you are starting a thread in your code... if you execute startAnimating/stopAnimating from the thread it is highly likely that you see strange behavior. Only the main thread can access the UI safely: http://stackoverflow.com/questions/3201761/warning-uikit-should-not-be-called-from-a-secondary-thread – sergio May 20 '11 at 22:03