我有一個UItabbarController與兩個視圖控制器。當我點擊一個視圖控制器中的登錄按鈕時,它應該帶我到其他tabbarController。當發生這種情況時,我得到當前tabbarcontroller頂部的第一個視圖控制器,它看起來像另一個。它可以在iPhone 6.0模擬器中正常工作,但在iPhone 5.0模擬器中描述失敗。一個視圖控制器出現在另一個視圖控制器在iOS 5和以下版本
在appDelegate.m:
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
switch (state) {
case FBSessionStateOpen:
if (!error) {
if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone)
{
FLogin *flogin=[[FLogin alloc]initWithNibName:@"FLogin" bundle:nil];
self.window.rootViewController=fblogin; // I think because of this I m getting this issue
}
}
}
在flogin.m
tab=[[[UITabBarController alloc]init]autorelease];
ViewController *searchViewController=[[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil]autorelease];
Account *account=[[[Account alloc]initWithNibName:@"Account" bundle:nil]autorelease];
[email protected]"My Account";
tab.viewControllers=[NSArray arrayWithObjects:searchViewController,account,nil];
for(UIViewController *tab1 in tab.viewControllers)
{
if ([[[UIDevice currentDevice] systemVersion] floatValue]>5.0 ||[[[UIDevice currentDevice] systemVersion] floatValue]==5.0)
{
[tab.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:16.0], UITextAttributeFont, nil]
forState:UIControlStateNormal];
}
}
[self presentModalViewController:tab animated:NO];
你改變你的根視圖控制器響應登錄? – 2013-04-05 13:35:14
iam僅在iOS 5.1,iOS 5 iOS 4.3和iOS 6中出現此問題沒有問題 – siva 2013-04-05 13:41:28
可能是我的應用程序中僅包含在iOS 6中的任何功能 – siva 2013-04-05 13:42:18