Handling of two common problems in iOS development

Source: Internet
Author: User

(i) "Unknown class Xxviewcontroller in Interface Builder file." Problem handling

Recently wrote a Xxviewcontroller class in the static library, and then in the main project Xib, the Xib class is specified as Xxviewcontroller, when the program runs, the following error is reported:

Unknown class Xxviewcontroller in Interface Builder file.

I have encountered this problem before, but I remember it is not very clear, so I began to find the answer on the StackOverflow.

In fact, this problem is not related to Interface Builder, the most direct reason is that the relevant symbol is not loaded from the static library. This problem is handled in Target's "Build Setting" –> "other Link Flags" with the "-ALL_LOAD-OBJC" the two identity bits, so OK.

(ii) About unbalanced calls to begin/end appearance transitions for ... Handling of the problem

One of our businesses has a need to go to a list and push a Web page immediately, doing some promotion. On iOS 8, our implementation is all OK, but on iOS 7, we found that the Web page push is not coming out, and the console gives a warning message, as follows:

Unbalanced calls to begin/end appearance transitions for ...

In this case, when you click the Back button in the navigation bar, a black screen appears directly.

We went to the StackOverflow to check, there is such a hint:

Occurs when you try and display a new viewcontroller before the current view controller is finished displaying.

This means that before the current view controller finishes displaying, it tries to display a new view controller.

So we went to check the code, sure enough, in the viewdidload inside to do a network request operation, and the request returned to push the web campaign promotion page. At this point, the current view controller may not show completion (that is, the push operation is not completed).

Basically you is trying to push both view controllers onto the stack at almost the same time.

When the two view controllers are pushed almost simultaneously to the current navigation controller stack, or if the pop has two different view controllers at the same time, an indeterminate result occurs. So we should make sure that there is only one operation on the same navigation controller stack at the same time, even if the current view controller is being animated, it should not go to push or pop a new view controller.

So finally we put the data request of the Web activity into the viewdidappear, and did some processing, so the problem solved.

Reference

  1. "Unbalanced calls to begin/end appearance transitions for Detailviewcontroller" when pushing more than one detail view con Troller

  2. Unbalanced calls to begin/end appearance transitions for Uitabbarcontroller


    Welcome to the developer Base: 2966696


    Reproduced in this article


Handling of two common problems in iOS development

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.