Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. View_Ciao *viewCiao;
  2. -(void) viewDidLoad {
  3. viewCiao = [[View_Ciao alloc] initWithNibName:@"View_Ciao" bundle:nil];
  4. [viewCiao.view setNeedsDisplay];
  5. [super viewDidLoad];
  6. }
  7.  
  8. - (void)applicationDidFinishLaunching:(UIApplication *)application {
  9.  
  10. [window addSubview:viewController.view];
  11. [window makeKeyAndVisible];
  12.  
  13. // create the second view, remove the first, and then display the second
  14.  
  15. viewCiao = [[ViewCiao alloc] init];
  16. [viewController.view removeFromSuperview];
  17. [window addSubview:viewCiao.view];
  18. }
  19.  
  20. @interface AppDelegate : ...
  21. {
  22. View_Hello *hello;
  23. View_Goodbye *goodbye;
  24. View_Ciao *ciao;
  25. UIViewController *currentView;
  26. UIWindow *window;
  27. }
  28. ... IBOutlet properties for the 3 controllers.
  29. @end
  30.  
  31. @implementation AppDelegate
  32. - (void)switchToGoodbye
  33. {
  34. [currentView.view removeFromSuperview];
  35. [window addSubview:goodbye.view];
  36. currentView = goodbye;
  37. }
  38. ... etc.
  39. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement