This might be asked a few time already, how do i call a function when poping back ?
NSlog show the text but nothing shows on the view after popping.
list pop to table but the image are not showing
DrinkListViewController
DrinkTableViewController *drinkTable = [[DrinkTableViewController alloc]init];
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[[self navigationController] popToViewController:obj animated:NO];
[drinkTable addImgViewAfterPopTime];
}
DrinkTableViewController
-(void)addImgViewAfterPopTime
{
[self performSelector:@selector(addImgViewAfterPop) withObject:nil afterDelay:3];
NSLog(@"casasasasa");
}
You are creating new instance of DrinkTableViewController when you are calling
DrinkTableViewController *drinkTable = [[DrinkTableViewController alloc]init];
so instead of doing this you can do like this:
DrinkListViewController.h
DrinkListViewController.m
and in DrinkTableViewController.m while initializing DrinkListViewController, you call setTarget method as follows: