演示按預期工作,沒有問題。但現在我正試圖將其整合到我的項目中。我沒有使用xib -s,只有代碼:無法使Twitter-OAuth-iPhone正常工作
OAuthTwitterDemoViewController * vc = [[OAuthTwitterDemoViewController alloc] init]; [[UIApplication sharedApplication] .keyWindow addSubview:vc.view]; [vc release];
它編譯並運行時沒有錯誤,但實際的OAuthTwitterDemoViewController永遠不可見。我也試過它從自定義viewController與[self.view addSubview:vc.view]
什麼是祕密?
更新:
確定,這裏就是我與NavigationController:
TwitterAuthViewController *vc = [[TwitterAuthViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
[vc release];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
您是否嘗試將視圖控制器推送到導航控制器?你的其他觀點是否正確顯示? – 2009-11-21 14:32:29
很快,本!是的,UINavigationController幫助了很多 - 我可以看到TwitterAuthViewController的視圖。但現在我得到了EXC_BAD_ACCESS ...將嘗試調查問題。 任何想法爲什麼它從UINavigationController工作,而不是我以前做過的? – cocoapriest 2009-11-21 14:39:56
順便說一句,我更新了代碼 – cocoapriest 2009-11-21 14:40:36