How to understand encapsulation .a static library
How to understand the encapsulation .a static library, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Encapsulate .a static library
To create a bundle, you only need to put the image resources in a folder such as p_w_picpathSource and change the suffix to .bundle.
Use resource pictures
$NSBundle * p_w_picpathSourceBundle = [NSBundle bundleWithPath: [[NSBundle mainBundle] pathForResource:@ "p_w_picpathSource" ofType:@ "bundle"]]
Splicing path
$if (retainFllow5) {/ / judge how many times to load p_w_picpathSuffix = [NSString stringWithFormat:@ "% dumped 2x", n];} else {p_w_picpathSuffix = [NSString stringWithFormat:@ "% dashed 3x", n];} $NSString * mosaic = [NSString stringWithFormat:@ "% @% @", p_w_picpathPrefix, p_w_picpathSuffix]; $NSString * p_w_picpathSource = [p_w_picpathSourceBundle pathForResource:mosaic ofType:@ "png"]
What you get here is the picture resources you need.
$[UIImage p_w_picpathWithContentsOfFile:p_w_picpathSource]
Add the required header files to the publicGroup
It is claimed that the .a files of release and debug are convenient for debugging and real machine use to merge the two versions.
$lipo-create / Users/chenwei/Desktop/XXX/debug/libPeopleKeybord.a / Users/chenwei/Desktop/XXX/release/libPeopleKeybord.a-output / Users/chenwei/Desktop/XXX/libPeopleKeybord.a
If you take a look, you will find that 1 is lipo-create. The later Path 2 is 1.an empty Path 3-the Path after output is the merged .a library you need.
Put .an and bundle into the same project file at the same time. The image resources needed by a will go to the .bundle to find it.
After reading the above, have you mastered how to understand how to encapsulate .a static libraries? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!