WEB开发网
开发学院手机开发iPhone 开发 How to (almost) create your own iPhone OS fram... 阅读

How to (almost) create your own iPhone OS framework

 2010-04-19 16:13:00 来源:WEB开发网   
核心提示:Step 3 (optional): Create references to the resulting .a files in the PseudoFramework project to make it easier to use.Create a new group in the project, call i

Step 3 (optional): Create references to the resulting .a files in the PseudoFramework project to make it easier to use.

Create a new group in the project, call it Dist. Right-click on it and select "Add existing files...". Add both libPseudoFramework-Debug.a and libPseudoFramework-Release.a files to it. Now, when you need to add the library to another project, you can just drag and drop it from XCode and don't need to open Finder and locate the files every time. Your project window should look something like this:

Step 4 (optional): Build libraries with different versions of the SDK.

If you plan to use same code with different versions of the iPhone SDK, you can build different static libraries, one for each version. To do that, create another set of build targets with a different SDK version in the 'Base SDK' field. You will want the names of your lib files to be different in order to avoid files being overwritten. I'd suggest appending 20 or 21 to file names to indicate that something was build for iPhone OS versions 2.0 and 2.1 respectively. Don't forget to modify the shell script to account for different file names. It should now look roughly like this:

# remove existing product lib files, just in caserm -rf build/${BUILD_STYLE}-iphoneos/libPseudoFramework20-${BUILD_STYLE}.arm -rf build/${BUILD_STYLE}-iphoneos/libPseudoFramework21-${BUILD_STYLE}.a# combine lib files for various platforms into onelipo -create "build/${BUILD_STYLE}-iphoneos/libPseudoFramework20 dev.a" "build/${BUILD_STYLE}-iphonesimulator/libPseudoFramework20 sim.a" -output build/${BUILD_STYLE}-iphoneos/libPseudoFramework20-${BUILD_STYLE}.alipo -create "build/${BUILD_STYLE}-iphoneos/libPseudoFramework21 dev.a" "build/${BUILD_STYLE}-iphonesimulator/libPseudoFramework21 sim.a" -output build/${BUILD_STYLE}-iphoneos/libPseudoFramework21-${BUILD_STYLE}.a

Another screenshot of the project window:

上一页  1 2 3 

Tags:How to almost

编辑录入:coldstar [复制链接] [打 印]
赞助商链接