iphoneiphone-sdk-3.0iphone-sdk-3.2

how to call a method in iphone applications?


i have a method in delegate.m file

-(void) switchToTabbarController  
{ 
  TabBarController *tabBarController = 
  [[TabBarController alloc] initWithNibName:@"TabBarController" bundle:nil];
  [self.window addSubview:tabBarController.view];
}

and i wanted to call this method from my LoginView Method. How to do it?


Solution

  • First I think you do not want to call it this way. I prefer not to call the UIApplication from a view and try to prevent it from a controller. Use a notification instead.

    But the way you could do this is:

    [(ApplicationDelegate *)[UIApplication sharedApplication].delegate switchToTabbarController]