Xcode4.6 Creating and using iOS Dylib Dynamic Library (reprint)

Source: Internet
Author: User

This is a Xcode4 method, Xcode3 method see Xcode3 Create and use iOS dylib dynamic Library

Find two directories, preferably open with two finder windows:

Directory One:

[Plain]View Plaincopy
    1. /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/xcode/specifications/

Catalogue TWO:

[Plain]View Plaincopy
    1. /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/library/xcode/specifications/

(This is only the iOS real version, simulator version similar,/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform)

Copy the contents of the Iphoneospackagetypes.xcspec and Iphoneosproducttypes.xcspec to the desktop (or any other place with write permission) and open it with Xcode, respectively.

Then use Xcode to open the MacOSX package Types.xcspec and MacOSX Product types.xcspec under directory two.

Put the MACOSX package Types.xcspec identifier for Com.apple.package-type.mach-o-dylib, drag to Iphoneospackagetypes.xcspec, make Iphoneospackagetypes.xcspe C becomes:

Put MacOSX Product Types.xcspec identifier for com.apple.product-type.library.dynamic, drag to Iphoneosproducttypes.xcspec, make IPHONEOSPRODUCTTYPES.XC Spec becomes:

Save the changes, the Iphoneospackagetypes.xcspec and Iphoneosproducttypes.xcspec copy back to the directory one, this time because there is no write permission to prompt authentication, enter the password.

To create a project template:

[Plain]View Plaincopy
    1. /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/xcode/templates/ Project templates/framework & Library/cocoa Touch Static library.xctemplate

Copy the entire folder to the desktop, rename the folder to Cocoa Touch Dynamic library.xctemplate, use Xcode to open the templateinfo.plist inside, modify three places:

Save, and then copy the Cocoa Touch Dynamic library.xctemplate back

[Plain]View Plaincopy
    1. /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/xcode/templates/ Project Templates/framework & library/

At this time also need to identify.

To restart Xcode, you can see:

Create an app project and a Dylib project, build dependencies, and copy dylib to bundles. (Click to view larger image)

Project of the dynamic library to set up the installation directory: (click to view larger image)

Demo/sample and the modified template: http://download.csdn.net/detail/hursing/5416617

After the app is installed, run it. Then modify the Uialertview message, compile, and use various tools (I use iphone Explorer on Mac) to overwrite the old dylib, reboot the program, and change the message successfully! Verify OK.

These are the methods of directly linking static libraries, or they can be dynamically loaded with the DYLD function. To put Dylib in the document folder, modify the installation directory, the first time to start to copy out Oh.

Transferred from: http://blog.csdn.net/hursing/article/details/8951958

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.