my app is nav based. in which i have a main tableView which shows feed items in cells. when a cell is clicked, a detailview is created which shows details of that feed item. i am working with push notifications now. when action button in notification is clicked,
(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo:
is called. how can i implement that method that if action button in notification is clicked. it should parse the feed again, reload the tableview, creates the latest feed items detailview and push it in navigational stack. i tried some code but it didn't work. here is the code i wrote.
in AppDelegate:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
RootViewController *controller = [[RootViewController alloc] init];
[controller newFeedItem];
}
in RootViewController:
- (void)newFeedItem
{
spinner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
spinner.frame=CGRectMake(130, 170, 50, 50);
[self.view addSubview:spinner];
[spinner startAnimating];
[self performSelector:@selector(doStuff) withObject:nil afterDelay:0.01];
}
-(void)doStuff
{
[[self stories] removeAllObjects];
[self startParsing];
[self.tableView reloadData];
// create detailview and push it in navigational stack
[spinner stopAnimating];
[spinner release];
}
but activity indicator is not appearing and tableView is also not reloading. Why is it happening so? Thanx in advance