开发者

Problem with modal dialog when rotating a view

I have a child view (not root, let it be view A) that can be rotated. Also I have a modal view (let it be view M) that is shown then a data comes in from the server. Our QA's found that if the data comes when the that view A is rotating, the modal view M will not be shown. In fact, the code to show the modal view will be executed, the app will go to the root view, but the user will not see the modal view.

The modal view M is shown with the following code:

[self.navigationController popToViewController:self.rootViewController animated:animated];    
[self performSelector:@selector(showModalAcceptDialog:) withObject:requestID afterDelay:0.1];  

(void)showModalAcceptDialog:(NSManagedObjectID*)requestID {
    RequestAcceptViewCon开发者_StackOverflowtroller *requestAcceptViewController = [[RequestAcceptViewController alloc] initWithNibName:@"RequestAcceptViewController" bundle:nil];
    requestAcceptViewController.requestID = requestID;
    [[self navigationController] presentModalViewController:requestAcceptViewController animated:YES];
    [requestAcceptViewController release];  
}

The delay is needed to perform navigation to the root view prior to showing the modal view. Otherwise, the app will crash with some internal exception.

Also view A in the landscape mode doesn't have a navigation bar and restores it when gets dissappeared (in viewWillDisappear), but in this case the navigation bar doesn't appear.

Please help me with this problem, because I have no idea how to fix it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜