-all_load, -ObjC

Introduction of the third party library, because the problem has been added to the -all_load. Why use -all_load?

The relevant parameters are -ObjC. This parameter is used to load and type related files (that is, all the files associated with the object are loaded in). OC does not define a link symbol for each function (method), which creates a link symbol for each class. So when a static library to use the category expansion when existing classes, do not know how to use the method of connector and the original category class in together, will cause the method you call in the category, “selector not recognize”.

in the 64 bit MAC system and the iOS system, the linker has a bug, will lead to only the static library contains a class can not use the -ObjC flag to load the file. The solution is to use -all_load or -force_load logo. To load all files in a static library. The difference is that -all_load is loaded with all libraries. -force_load must specify a specific file.

According to the above understanding, if the use of -ObjC, we must use the -all_load. Because -all_load is used to solve bug.

then the problem, when we use the other third party libraries have been only -ObjC, while the introduction of Baidu map, there is such a word:
if you only in the Xib file using BMKMapView, without the use of BMKMapView in the code, the compiler will not link in the link corresponding to the symbol. The project properties explicitly set: Xcode Project -> Edit Active Target -> Build Setting -> Other Linker Flags add -ObjC
for this reason does not because of the use of the category,, but did not show introduction. That is to say, under normal circumstances, do not add -ObjC on the line.

and now the result of the introduction of -all_load is the result of the former will not be fully compiled arm64, will now participate in the.

-all_load, -ObjC
prompt with the same name zip.o

Based on the path name of the alert, the

-all_load, -ObjC
compiler generated files

So the solution is to change the name of the zip file, or third party library to remove the -all_load parameters. In addition to
, but also know, compile the static library, in fact, also includes the code in our project. Such as zip.o….

PS: welcome everyone to pay attention to my WeChat public number, a lot of exchange ~ ~

-all_load, -ObjC
AlwaysBlue