2012-03-31 11 views
1

大きなトラブルの後、最終的には最初のナビゲーション/ ViewControllerをロードできましたが、今はサブアイテムのどれもクリック可能ではありません。つまり、2つのテキストフィールド、2つのボタン、およびスイッチがありますが、クリックしても何もしません。これらの要素はiPad用のxibシミュレータで動作するので、私のxibファイルでは問題ではないことは分かっています。ルートビューコントローラのアイテムはクリックできません

これは私のアプリケーションがこれまで使用していたすべてのコードであり、クリック可能ではない理由はわかりません。

MainWindow.xib =空のnibファイル

int型のretval = UIApplicationMain(argcの、ARGV、nilに、 "iPadAppDelegate" @ )。

アプリケーション:didFinishLaunchingWithOptions:

self.window = [[UIWindow alloc] init]; 

UIViewController *login = [[UIViewController alloc] initWithNibName:@"iPadLoginView" bundle:nil]; 

UINavigationController *nav_controller = [[UINavigationController alloc] initWithRootViewController:login]; 

self.window.rootViewController = nav_controller; 
[self.window makeKeyAndVisible]; 


return YES; 

答えて

3

は交換してくださいあなたの

self.window = [[UIWindow alloc] init]; 

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 

[self.window addSubview:nav_controller.view]; 
+0

おかげで

self.window.rootViewController = nav_controller; 

交換してください。私はここに似たものを見つけました:http://stackoverflow.com/questions/4373729/programmatically-created-window-appears-but-doesnt-respond-to-touch-events window.screen = [UIScreen mainScreen]; はもう少しコンパクトです – user1122069

+0

あなたは貧しい人の魂 – Justin