Imagine I have this method I want to call in the background.
- (void)loadView
{
[super loadView];
//Make a button which will fire the "buttonClicked" method
//Make my own uitableview.
//Fire method: "theBackGroundMethod" in the background.
}
I'm sorry about the vagueness but I'll try to be as clear as I can. The following is what I want to do. I have a view, I but this button on it and an empty UITableView. Then I want theBackGroundMethod to run the the background, while this is running I want to be able to click the button and fire the buttonClicked method which will shoot data into the UITableView.
The following I have tried with negative results:
[self performSelectorInBackground:@selector(theBackGroundMethod) withObject:nil];
This starts theBackGroundMethod but it doesn't load the data which I ask from the server.
[self performSelectorOnMainThread:@selector(theBackGroundMethod) withObject:nil waitUntilDone:NO];
This starts theBackGroundMethod but it doesn't allow me to click the button for some reason, well it allows be to click the button but every action I do while the method is firing the clicks are put in queue behind it, so only when the backgroundmethod is done the x times I pressed the button is handled.
Does anyone have an idea what might block the use of any of the performSelector-functions described above and how to resolve them. Or have an entire (maybe better) idea..?