Why can't I push a new view controller onto the current view?

后端 未结 4 877
半阙折子戏
半阙折子戏 2021-01-26 04:50

I am using the following code and getting the following errors:

\"Showing

4条回答
  •  无人共我
    2021-01-26 05:16

    I'm going to say that you've not imported ChangePasscode.h in your current file.

    Update: In response to comment thread below, you'll need to actually create a nav structure if you want to push view controllers. The preferred way in iOS 5 is as follows:

    // AppDelegate.h
    // …Other existing code
    @property (nonatomic, retain) UINavigationController *navController;
    @end
    
    // AppDelegate.m
    @synthesize navController;
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      navController = [[UINavigationController alloc] initWithRootViewController:viewController];
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
      self.window.rootViewController = navController;
      self.window.backgroundColor = [UIColor whiteColor];
      [self.window makeKeyAndVisible];
      return YES;
    }
    

提交回复
热议问题