让我澄清一些事情,我不是为越狱手机做这个,我这样做是因为手机上的锁定按钮被打破了,我只是想不必等待1分钟让屏幕锁定.所以我想我可以在AppDelegate.h的开头有一个名为lockScreen的应用程序.这不是AppStore,它只适合我.
我见过有人说他们可以使用GSEventLockDevice();从GraphiCSServices.framework导入GSEvent.h时,但是当我尝试运行它(在设备和模拟器上)时,我得到了这个,并且它不会构建:
Undefined symbols for architecture armv7s: "_GSEventLockDevice",referenced from: -[AppDelegate application:dIDFinishLaunchingWithOptions:] in AppDelegate.old: symbol(s) not found for architecture armv7sclang: error: linker command Failed with exit code 1 (use -v to see invocation)
我不完全确定这意味着什么.如果我删除行GSEventLockDevice();但仍然导入GSEvent.h,一切正常.
我的设备是否需要越狱才能使用此功能?
char *gsDylib = "/System/library/PrivateFrameworks/GraphiCSServices.framework/GraphiCSServices";voID *handle = dlopen(gsDylib,RTLD_Now);if (handle) { BOol locked = FALSE; voID (*_GSEventLockDevice)() = dlsym(handle,"GSEventLockDevice"); if (_GSEventLockDevice) { _GSEventLockDevice(); //... } dlclose(handle); //...}总结
以上是内存溢出为你收集整理的ios – 以编程方式锁定设备上的屏幕全部内容,希望文章能够帮你解决ios – 以编程方式锁定设备上的屏幕所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)