如果您已經在對故事板的viewController,那麼你可以像下面的代碼&您必須設置標識符viewControler在故事板
ssSecondViewController *tempView =[self.storyboard instantiateViewControllerWithIdentifier:@"yourIdentifier"];
設置你的viewController ID在這裏被分配給它,在下面的圖像標識爲「MenuViewController」
,如果它是的.xib文件,然後
ssSecondViewController *tempView =[[ssSecondViewController alloc] initWithNibName:@"yourIdentifier" bundle:nil];
,如果你只是想和programmetically添加新的viewController不使用已有的viewController,那麼你有initWithFrame
來初始化它,然後它顯示的viewController
ssSecondViewController *tempView =[[ssSecondViewController alloc] initWithFrame:CGRectMake(0,0,320,480)];
ssSecondViewController *tempView =[[ssSecondViewController alloc] init];
此行只是分配的viewController,它不有任何地點來繪製它。
我應該補充說我正在使用故事板和xcode 4.5 – user1362262 2013-02-10 01:11:11