Ios:push Viewcontroller presenting view controllers on detached view controllers is discouraged warning

Source: Internet
Author: User

Cause: A,b,c three viewcontroller,a as the root view, B.view is added to a, and the Modal (Presentviewcontroller) POPs C in B.

In this case, a caption warning will appear.

Workaround:

1. [self. View. Window. RootviewcontrollerPresentviewcontroller: Controller
Animated:YEScompletion:nil];

/* Here's an explanation

 the Reason of this warning is I am presenting a view controller over a small view it is not full size view. Given below is the image of my project. Where on click on the four option above. User navigate to different Childviewcontroller ' s view. (It works like Tabviewcontroller). But the Childviewcontroller contains view of small size. So if we present a view from Childviewcontroller it gives this warning.

*/

I also think that this is a temporary solution to the problem, this method appears to solve the problems, the actual may be in special cases caused more serious bugs

2. Correct use of Viewcontroller, this problem is caused by misuse of Viewcontroller

Resources:

Http://stackoverflow.com/questions/19890761/warning-presenting-view-controllers-on-detached-view-controllers-is-discourage

http://onevcat.com/2012/02/uiviewcontroller/

Ios:push Viewcontroller presenting view controllers on detached view controllers is discouraged warning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.