Make a dynamic library. Framework Summary

Source: Internet
Author: User

This process is made in debug mode, the release process is the same, and the run release mode is modified
Create a project
Create a pair of files
Add method + (void) TestMethod;
+ (void) testmethod{

NSLog (@ "-=-=-=-=-=-=-=-");

}
Set the newly added. h file to visible
At this point, the TestMethod method is dragged to public in project


A framework file that generates two environments, respectively, in an emulator and a true machine environment


Merging the framework files of two environments
Click New Run Script Phase

Add script if ["${action}" = "Build"]
Then
Install_dir=${srcroot}/products/${project_name}.framework

Device_dir=${build_root}/${configuration}-iphoneos/${project_name}.framework

Simulator_dir=${build_root}/${configuration}-iphonesimulator/${project_name}.framework

If [-D "${install_dir}"]
Then
Rm-rf "${install_dir}"
Fi

Mkdir-p "${install_dir}"

Cp-r "${device_dir}/" "${install_dir}/"
#ditto "${device_dir}/headers" "${install_dir}/headers"

Lipo-create "${device_dir}/${project_name}" "${simulator_dir}/${project_name}"-output "${INSTALL_DIR}/${PROJECT_ NAME} "
#open "${device_dir}"
Open "${srcroot}/products"
Fi



Run the merged framework folder after it pops up

Set to Dynamic Library compilation
Create complete
Import the framework to use in the project you are using

#import <testFrame/testMethod.h>

-(void) Viewdidload {
[Super Viewdidload];
Do no additional setup after loading the view, typically from a nib.
[TestMethod TestMethod];
}

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.