Q:

IPhone+performselector in background

Can anyone help me with performSelectorInBackground? I want to reload table with updated data in performSelectorInBackground.

A:

What you can do is you just get the data in the background thread and you can return back to main thread once you get the data and update the tableview in main thread.
- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
   //All your views cell creations and other stuff
   [self performSelectorInBackground:@selector(loadDataThatToBeFetchedInThread:) 
                          withObject:objectArrayThatNeedToFetchData];
}

- (void) loadDataThatToBeFetchedInThread:(NSArray *)objectThatNeedToFetchData
{
    //Fetch the data here. which takes place in background thread
    [self performSelectorOnMainThread:@selector(updateTableViewWithTheData:) 
                           withObject:responseData 
                        waitUntilDone:YES];
}

- (void) updateTableViewWithTheData:(NSMutableArray *)yourData
{
    //Update Data to tableview here
}

