xcode 中使用iPhone私有API
来源:互联网 发布:淘宝上买岛国片 编辑:程序博客网 时间:2024/06/11 21:52
http://aralbalkan.com/2106
Today I had to use a private API while spiking a feature for an iPhone app I'm working on and I ran into a couple of gotchas along the way. There doesn't seem to be a simple step-by-step guide for using private iPhone APIs in XCode, so here's goes:
- First off, you're going to need the header files for the private frameworks. To dump them, use theFramework Dump Kit from Erica Sadun's site. Download theDumpFrameworks Perl script anywhere and put the class-dump binary somewhere on your path (I put it in /usr/local/bin/)
- Run DumpFrameworks (navigate to the folder you downloaded it to in Terminal and type
./DumpFrameworks
). This will create the headers in~/Headers. - In your XCode project, right-click the Frameworks folder in the Groups & Files panel and selectAdd →Existing Frameworks. Navigate to the header file(s) you want to add and select them. You should see the headers added to your project.
- Go to Project → Edit Project Settings, click on the Build tab, and scroll down to the Linking section. For theOther Linker Flags property, enter
-force_flat_namespace
and-undefined suppress
(thank you,Ken Ferry). If you forget this, you will get a linker error telling you that the symbols for the private classes you're using could not be found. - Open up the header files you imported into your project and remove the superfluous import statements that the header dumper put there. Usually this is just an unnecessary
#import "NSObject.h"
but there may be others also. If you get errors, look for theSomeHeader.h: No such file or directory messages and remove the import statements corresponding to those errors from the private header files. - Finally, import the private header files, use the classes in your application, build and run!
Of course, whether or not you should use the iPhone private API is another matter (undocumented calls may break at any time, Apple may reject your app, etc.) If you do want to play around with them, however, I hope the above instructions help you to get started without too much pain.
The Private iPhone APIs in XCode for Dummies article byAral Balkan, unless otherwise expressly stated, is licensed under aCreative Commons Attribution-Noncommercial 2.0 UK: England License.
- xcode 中使用iPhone私有API
- iPhone私有API使用
- iPhone私有API使用学习
- iPhone私有API使用学习笔记
- iPhone私有API使用学习笔记
- iphone 私有api
- Iphone的私有API
- 【iPhone Xcode】在Xcode3中使用SVN
- 私有API简单使用
- 获取iphone ip 非私有方法 iphone xcode
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API--- UISegmentedControl
- iPhone开发技巧之私有API--- UITableView
- iPhone开发技巧之私有API--- UIApplication
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API
- iphone SprintBoard部分私有API总结
- 【转载】女浴室起火之九个震撼的故事,不看一定会后悔
- MyEclipse自动生成接口和JUnit测试类
- 获取SQLSERVER一张表里面的常用字段信息
- 国际域名的分类
- vb.net 使用code128 代码
- xcode 中使用iPhone私有API
- 光电耦合器原理及应用介绍
- mp4文件格式入门
- 诗词-我儿名字藏头,你能猜出来,算你牛
- CListCtrl使用技巧
- Windows上安装ubuntu(wibi)
- trac中gitweb的使用
- prepareStatement的简单示例及标准的与数据库连接示例
- NHibernate本表关联配置