Solutions to 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!
Recommended reading:
After ios8 jailbreak, the display recorder cracked gesture cannot be used as a solution
After ios8 jailbreak, cydia cannot install plug-ins. Solution
Apple ios development guide pdf official version
Rating:
Category: usage instructions