I'm a bit confused. I have 2 classes, an app delegate and a view controller. In my app delegate I get some data via this method:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSDictionary *results = [responseString JSONValue];
NSArray *allTweets = [results objectForKey:@"results"];
[viewController setTweets:allTweets];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
and in my view controller I have a button that should reload the data...I've tried a few things such as
Twitter_SearchAppDelegate *appDelegate= (Twitter_SearchAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate connectionDidFinishLoading];
but none worked...am I going about this in the wrong way? I just want to be able to call the method that loads the data in the first place from the app delegate to the view controller. Any help is appreciated!