IOS Development Framework

Source: Internet
Author: User

advantages and disadvantages of making the framework

Benefits:

1, if the inter-module interface definition is relatively perfect, the modular program has a good scalability and cohesion;

2, the physical modularity facilitates the management and testing of the development process, especially in the relatively large scale of the program.

3, if the glue language can be used as a binder, the program can be used at very little cost to adapt to future changes.

4, can physically implement the module of IOS program.

Insufficient:

1, because it is a static library, there should be no loss of running time, but has not been tested, not sure.

2, the load of resources this part, do not know whether to occupy more memory, no test, not sure.

In project development, it is common to share code. Due to the limitations of iOS, we cannot share code in the form of "dynamic libraries". In addition to source code, we can only select static libraries to share the code.

The true framework Project shares code in the compiled binary form and is essentially a static library. However, because of the limitations of Xcode (no corresponding project template is provided), it is still cumbersome to compile the static library in the form of a framework.

This is the manual framework of the method, someone online made an engineering template, you can directly generate the framework engineering:

Download Frame First: https://github.com/kstenerud/iOS-Universal-Framework

Unzip find realframework into Find install.sh, right click Open mode, open with terminal, the real framework to join Xcode

Open into the shell

Open Enter Ctrl + C, and then enter

Then enter Y

Enter the password for your machine: then enter

Final hint installation complete. Please restart Xcode. Congratulations on your success.

Then open Xcode to create a new framework

Then create a new testframework, and then create a new Mytestclass class

Then add the method in the MyTestClass.h

-(void) testfunction;

Then implement the method in the MYTESTCLASS.M

then add the desired header file to public in the copy headers in bulid phases

Move MyTestClass.h to Public

Then Bulid & Run,ok! Ha ha!

The next step is to drag the build->products->debug-iphonesimulator->testframework.embeddedframework generated above into the project you want to use.

The next step is to add testframework.framework to the link binary with Libraries, which can be dragged directly from the left column of the project into this area.

And then just go into the header file in the class you're going to use,

#import <TestFrameWork/myTestClass.h>

Then define the object and then Bulid & Run will be OK!

Congratulations on your second method. haha!

There are also reminders:

2. When creating the framework or LIB, if the category is used, the program that uses the FMWK will be crash when it is run, and the other linker flags in the project need to add two parameters-objc-all_load

3. Compiling the framework is, you need to put generatedebugsymbols =no, otherwise there will be many warning:

Similar

IOS Development Framework

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.