views:

273

answers:

1

I am aware of my problem but cannot find a solution. When the button is pressed it tells the UIActivityIndicatorView to startAminating and also retrieve data from a XML feed. Problem I am having is it runs the whole event before starting the animating of the loader, so the loader never spins before the data is retrieved. How can I start the loader's animation and then once it has started continue with getting data from the XML feed?

-(IBAction)getXMLData {
    [loader startAnimating];

    [self retrieveXML];
}
. 
. code
. more code
.
-(void)retrieveXMLEnded {
   [loader stopAnimating];
}
A: 

Strart animation in other thread

[loader performSelectorInBackground: @selector(startAnimating) withObject: nil];
oxigen
Thank You! I used [self.view performSelectorInBackground: @selector(addSubview:) withObject: ActivityBuildingView]; to display a custom loading screen.
bbullis21