У меня есть два метода в приложении делегат
-(void)goTo1{
[self.window addSubview:[viewController view]];
[settingsViewController.view removeFromSuperview];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
//removing the settingsViewController form the view and setting the animation
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:NO];
[UIView commitAnimations];
[settingsViewController release];
settingsViewController = nil; }
и
-(void)goTo2{
//calling the .xib file and the SettingsViewController
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
[self setSettingsViewController:aSettingsView];
[aSettingsView release];
[self.window addSubview:[settingsViewController view]];
//moving the view 30px down
[[settingsViewController view] setFrame:CGRectMake(0, 20, 320, 460)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
//setting the animation
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[UIView commitAnimations];
[webskiAppBetaViewController release];
webskiAppBetaViewController = nil;
}
и IBActions во 2-х контроллерах вида первый One
-(IBAction)goToView2{
WebskiAppBetaAppDelegate *mainDelegate = (WebskiAppBetaAppDelegate *)[[UIApplication sharedApplication] delegate];
[mainDelegate goTo2];
}
и второйone
-(IBAction)goToView1{
WebskiAppBetaAppDelegate *maniDelegate = (WebskiAppBetaAppDelegate *)[[UIApplication sharedApplication] delegate];
[maniDelegate goTo1];
}
поэтому теперь, когда я вызываю goToVIew1, я также хочу запустить метод, который находится в представлении 1
что-то вроде этого
-(IBAction)goToView1{
WebskiAppBetaAppDelegate *maniDelegate = (WebskiAppBetaAppDelegate *)[[UIApplication sharedApplication] delegate];
[maniDelegate goTo1];
[self methodInFirstVIew]; //this method is in the first view
}