2011-11-27 81 views
0

將我的頭靠在牆上。覺得這應該是簡單的,但只是無法弄清楚。Presentmodalviewcontroller導致mkmapview消失

我有一個UIViewController設置爲其rootviewcontroller的窗口。在rootviewcontroller中,我有一個全屏mkmapview。 Catch是,當調用當前的modeview控制器時,我看到我的mkmapview完全消失了(我的viewcontroller視圖的顏色立即出現),就像新屏幕飛入一樣。一旦我解除了ModalViewControllerAnimated,它會返回到(黑色)屏幕。

我已經通過刪除IB中mapview的iboutlet來測試了一下 - 然後轉換工作就像一個魅力。

我不認爲這是這個代碼我使用模板工具應用爲導向 - 只是給一些物質:

-(IBAction)settingsGearPressed:(id)sender 
{  
    SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil]; 

    controller.delegate = self; 
    controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 

    [self presentModalViewController:controller animated:YES]; 
} 

回答

0

我想通了。基本上我是在ViewWillDissapear中刪除mapview - sheesh。有時間多睡一會兒。