Hi. I am looking at the sample SeismicXML code as a base for my app. What I am looking to do is call the function again from the RootViewController and update the data being displayed for a different URL. I modified the code as follows, but has not had any luck making it work as the data does not get passed back to the RootViewController.
Basically I added a button to the RootViewController and call the function
Code:
XMLParsingAppDelegate *gtData = [[XMLParsingAppDelegate alloc] init];
[gtData getMyData];
[gtData release];
I modified the original AppDelegate by moving a portion of the code from the applicationDidFinishLaunching to:
Code:
- (void) getMyData {
static NSString *feedURLString = @"http://mysite/rss/iphone/news2.aspx?Id=0";
NSURLRequest *dataURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:feedURLString]];
//self.dataFeedConnection = [[[NSURLConnection alloc] initWithRequest:dataURLRequest delegate:self] autorelease];
self.dataFeedConnection = [[[NSURLConnection alloc] initWithRequest:dataURLRequest delegate:self] autorelease];
NSAssert(self.dataFeedConnection != nil, @"Failure to create URL connection.");
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
And moved the dataList references to the parseEarthquakeData section
Code:
self.dataList = [NSMutableArray array];
rootViewController.dataList = dataList;
When I run and debug, the self.dataList is being populated with the array data; however, the RootViewController.tableView never sees this data. It probably has something to do with the delegates. Any help or sample code someone could provide would be greatly appreciated.