2012-06-29 57 views
0

我不知道如何使用IBAction和and Button從一個窗口移動到另一個窗口,但是如果它們是執行「應用程序didFinishLaunchingWithOptions」的方法,那麼我正在遊蕩BOOL當前(自創建以來未更改)它看起來像這樣在基於視圖的應用程序中設置初始化視圖

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

// Override point for customization after application launch. 

// Set the view controller as the window's root view controller and display. 
self.window.rootViewController = self.viewController; 
[self.window makeKeyAndVisible]; 

return YES; 
} 

任何關於此事的幫助都會大受歡迎。

回答

0

在網上搜索了2個小時後,很明顯我是唯一一個問過這樣一個問題的人。但在經歷了1個半小時的嚴重失敗之後,我做出了一個解決方案。有三件事你必須做你首先必須進入appDelegate.h和更改以下

@class originalpageVeiwController; 

@interface snakeAppDelegate : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    originalpageVeiwController *viewController; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet originalpageVeiwController *viewController; 

@end 

變化@class originalpageVeiwController到secoundpageViewController以及該文件的其餘部分做相同的基礎(2多個正好文件(@interface和@屬性))。

然後打開MainWindow.xib,然後單擊原始頁面的VeiwController圖標,進入屬性檢查器(⌘1)並將ViewController下的NibName更改爲secoundpageViewController,然後轉到身份檢查器(⌘4)並更改類標識下的類到secoundpageViewController,然後將更改保存到MainWindow並構建並運行。

相關問題