Meanings of xcode other linker flag

Source: Internet
Author: User

Address: http://blog.csdn.net/shaobojohn/article/details/7953007

An exception was thrown during project compilation today. <nsinvalidargumentexception> + [nsinvocation invocationwithmethodsignature:]: Method signature argumentcannot be nil. However, we can see that this class exists in the project. Finally, we thought about it. Because the runtime call is used and the import is not in the header file, we cannot find this class during link, after reading it online, you only need to go to other
You can add-objc to the linker flag and find it correct after adding it. However, you still need to understand the meaning of this compilation option, so I checked it on the network, finally, find an English explanation.

-All_load loads all members of static archive libraries.

-Objc loads all members of static archive libraries that implement an objective-C class or
Category.

-Force_load (path_to_archive) loads all members of the specified static archive library. Note:
-All_load forces all members of all archives to be loaded. This option allows you to target a specific archive.

-All_load is used to load all the members in the static library file.-objc is used to load all the members that implement a class or classification in the static library file.-force_load (package path) load all the members in the static library file of the specified path. Therefore, the reflection call method when using runtime should use one of the three links to ensure that all classes can be loaded into the memory for dynamic calls by the program.

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.