How to (almost) create your own iPhone OS framework
2010-04-19 16:13:00 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鎯у⒔閹虫捇鈥旈崘顏佸亾閿濆簼绨绘い鎺嬪灪閵囧嫰骞囬姣挎捇鏌熸笟鍨妞ゎ偅绮撳畷鍗炍旈埀顒勭嵁婵犲嫮纾介柛灞捐壘閳ь剛鎳撻~婵嬪Ω閳轰胶鐤呯紓浣割儐椤戞瑩宕ョ€n喗鐓曟い鎰靛亝缁舵氨绱撻崘鈺傜婵﹤顭峰畷鎺戔枎閹搭厽袦婵犵數濮崑鎾绘⒑椤掆偓缁夌敻骞嗛悙鍝勭婵烇綆鍓欐俊鑲╃磼閹邦収娈滈柡灞糕偓鎰佸悑閹肩补鈧尙鏁栧┑鐐村灦閹稿摜绮旈悽绋课﹂柛鏇ㄥ灠閸愨偓濡炪倖鍔﹀鈧繛宀婁邯濮婅櫣绱掑Ο璇茶敿闂佺ǹ娴烽弫璇差嚕婵犳碍鏅插璺猴工瀹撳棝姊虹紒妯哄缂佷焦鎸冲畷鎴﹀箻鐠囧弶宓嶅銈嗘尰缁嬫垶绂嶉悙顒佸弿婵☆垳鍘ф禍楣冩倵濮樼偓瀚�

As of iPhone SDK version 2.1, it doesn't seem to be possible to package your own code into an iPhone OS framework. Messing around with OS X 10.5 framework build options didn't yield any useful results for us. The closest we got is a static library built for each platform (iPhone OS and the Aspen simulator), bundled up into one file (using a command line tool called 'lipo') and a set of header files that you would reference in order to use the library.
Setting: You have several implementation files with the corresponding header files that you'd like to reuse in another iPhone app project.
Step 1: Create static libraries for iPhone OS and iPhone Simulator.
You need to create one "static library" build target for each platform in an empty project. Create a new "Window-Based Application" project for iPhone OS. Delete all source and NIB files and remove all references to frameworks that your library won't be using. Keep the .pch file. Remove the existing build target. At this point, your project should look something like this:

In order to bundle lib files for different platforms into one, we need to build them separately first. To do that, create 2 new "Static Library" build targets, we'll call them 'PseudoFramework sim' and 'PseudoFramework dev' for Simulator and device, respectively. Add your library source and header files. In the build settings for target 'PseudoFramework sim', click on 'Base SDK' and select 'Simulator - iPhone OS'; 'PseudoFramework dev' should be using the 'Device - iPhone OS' Base SDK. At this point you should be able to build separate .a files by selecting "Active SDK"->"Use project settings" from the dropdown box on top, selecting your desired configuration (debug or release) and right-clicking on each target and selecting "Build" from the menu. At this
- ››TOscilloscope 仿Windows任务管理器CPU使用记录组...
- ››How to Make a Dark, Post-Apocalyptic City Illu...
- ››tomcat不支持TCP/IP6协议
- ››tomcat 下的 url 大小写问题
- ››tomcat6.0.28 内存溢出PermGen Space
- ››Tomcat 系统架构与设计模式,第 2 部分: 设计模式...
- ››Tomcat 系统架构与设计模式,第 1 部分: 工作原理...
- ››How to (almost) create your own iPhone OS fram...
- ››TOMCAT和IIS整合
- ››Tomcat性能调优方案
- ››Tomcat6 下 MySQL 5.1 数据源配制
- ››Tomcat启动分析server.xml
更多精彩
赞助商链接