1 Star 0 Fork 0

人间不知德/uidevice-extension

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
UIDevice-IOKitExtensions.h 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Erica Sadun 提交于 2012-07-02 14:21 . Partial update
/*
Erica Sadun, http://ericasadun.com
iPhone Developer's Cookbook, 3.0 Edition
BSD License, Use at your own risk
*/
/*
http://broadcast.oreilly.com/2009/04/iphone-dev-iokit---the-missing.html
In Xcode, I was surprised to see that Apple didn't include IOKit header files. When I tried to
add #import <IOKit/IOKit.h>, the file could not be found. So I manually put together a simple
header file by hand, added IOKit to my frameworks and attempted to compile.
As you can see from the screenshot at the top of this post, I failed to do so. Xcode complained
that the IOKit framework could not be found. Despite being filed as public, IOKit is apparently
not meant to be used by the general public. As iPhone evangelist Matt Drance tweeted,
"IOKit is not public on iPhone. Lack of headers and docs is rarely an oversight."
In the official docs, I found a quote that described IOKit as such: "Contains interfaces used by
the device. Do not include this framework directly." So in the end, my desire to access that IOKit
information was thwarted. For whatever reason, Apple has chosen to list it as a public framework
but the reality is that it is not.
*/
#import <UIKit/UIKit.h>
#define SUPPORTS_IOKIT_EXTENSIONS 1
/*
* To use, you must add the (semi)public IOKit framework before compiling
*/
/*
This category is no longer maintained.
*/
#if SUPPORTS_IOKIT_EXTENSIONS
@interface UIDevice (IOKit_Extensions)
- (NSString *) imei;
- (NSString *) serialnumber;
- (NSString *) backlightlevel;
@end
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/worldunknowme/uidevice-extension.git
git@gitee.com:worldunknowme/uidevice-extension.git
worldunknowme
uidevice-extension
uidevice-extension
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385