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
- /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/xcode/specifications/
Catalogue TWO:
[Plain]View Plaincopy
- /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
- /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
- /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