I have a tableView with a list of items. When a selection is made, a new view controller is pushed on the tableView's navigationController viewController stack.
My question is this: one of the views in the view hierarchy associated with the pushed view controller requires the fetching of data from the network before it can render it's content. This fetching is done asynchronously via [NSURLRequest requestWithURL: ...]. What is the proper way to pass the data to the view that needs it and have that view call it's overloaded drawRect method? Currently, I do this:
(void)connectionDidFinishLoading:(NSURLConnection *)connection {
[_connection release]; _connection = nil;
[self performSelectorOnMainThread:@selector(GetDataFromCloudAndCreateView) withObject:nil waitUntilDone:NO];
}
Method GetDataFromCloudAndCreateView instantiates the view form the data. Unfortunately, nothing is being rendered. I have tried [myView setNeedsDisplay] but it has no effect.
Could someone sketch the proper way to do this? Thanks.