I have two separated classes FirstController and SecondController, created with storyboards. The problem is that I want to call method in SecondController.m, FROM FirstController. For ex. :
SecondController.m
-(void)myMethod:(CGPoint)pt {...} // It's important that there is a paramterer
FirstController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// Call myMethod
}
How to do this in the easiest way?
Update: I want to use notification from 'aBilal17' link:
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"updateLeftTable"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(checkRes:) name:@"updateLeftTable" object:nil];
(..)
-(void)checkRes:(NSNotification *)notification
{
if ([[notification name] isEqualToString:@"updateLeftTable"])
{
[myMethod ?
}
}
In other class:
[[NSNotificationCenter defaultCenter] postNotificationName:@"updateLeftTable" object:self];
But now, how to pass my CGPoint argument using this?