IOS: Class Foo is implemented in both MyApp and OtherApp. One

Source: Internet
Author: User

When you build your app on the ipad, the following prompt appears:
Objc [1334]: Class ASIAuthenticationDialog is implemented in both/var/mobile/Applications/DDD5C5F0-49E4-425F-AEAE-0AC27FA8A0AC/MyApp. app/MyApp and/Library/MobileSubstrate/DynamicLibraries/SogouInputIPad. dylib. one of the two will be used. which one is undefined.

The prompt indicates that ASIAuthenticationDialog is used in both the app and sogou input methods. As a result, objc-runtime cannot decide whether to call the implementation in that program.
Find the reason for data discovery: The objc runtime uses the same namespace for the app. The operating mechanism is as follows:
First, the binary image is loaded and the program dependency is checked.
When each binary image is loaded, the objc classes of the program is registered in the objc runtime namespace.
If a class with the same name is loaded again, the behavior of objc runtime is unpredictable. One possibility is that the class of any program will be loaded (this should also be the default action)
This warning is triggered only when the app and sogou input method both use the ASIHTTPRequest third-party encapsulation.
If we cannot obtain the source code of conflicting apps, the corresponding solution I found is to rename the same class, but this is complicated.
The solutions found are mainly for ios unit test. For different apps, you can only rename your own classes.
 
The Bundle Loader and Symbols hidden by default mentioned in the document can be searched in Build Settings of TARGET.


To sum up, write apps using classes that come with Cocoa touch as much as possible, and use less third-party encapsulation.

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.