Two common problems in ios development

Source: Internet
Author: User

Two common problems in ios development

There are two common problems in ios development! As we all know, Apple's mobile phone uses the ios system, and the number of users is huge, so ios development has become a very popular industry. The following section describes how to solve two common problems in ios development. I hope to help technicians in ios development!

Two common problems in ios development

I. troubleshooting of "Unknown class XXViewController in Interface Builder file ."

Recently, I wrote a XXViewController class in the static library. In the xib of the main project, I specified the xib class 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 do not know it clearly, so I started to find an answer on stackoverflow.

In fact, this problem has nothing to do with Interface Builder. The most direct reason is that the related symbol is not loaded in the static library. The solution to this problem is to add the-all_load and-ObjC identification spaces in the "Build Setting"> "Other Link Flags" of the Target, so that it is OK.

Ii. About "Unbalanced cballs to begin/end appearance transitions ..." Troubleshooting

One of our businesses has such a need. after entering a list, we need to immediately push another web page for promotion. On iOS8, our implementation is all OK. But on iOS7, we found that the web page cannot be pushed, and the console gave a warning message, that is, the following:

"Unbalanced cballs to begin/end appearance transitions ..."

In this case, a black screen is displayed when you click the return button in the navigation bar.

We checked on stackoverflow and found the following prompt:

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

This means that the current view controller tries to display a New View Controller before it is displayed.

So we checked the code and found that the network request operation was performed in viewDidLoad, and the web activity promotion page was pushed after the request was returned. At this time, the current view controller may not be displayed completely (that is, the push operation is not completed ).

"Basically you are trying to push two view controllers onto the stack at almost the same time ."

When two view controllers are pushed to the current navigation controller stack almost simultaneously, or two different view controllers are pop at the same time, there will be uncertain results. Therefore, we should ensure 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, we should not push or pop a New View Controller.

In the end, we put the web activity data request in viewDidAppear and processed it. This solved the problem!

Note: For more exciting tutorials, please follow the help houseDesign tutorialTopic,

Related Article

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.