【发布时间】:2022-08-05 00:36:56
【问题描述】:
我刚刚开始学习如何编写 iOS 调整。试图在theos中写一个tweak,但是这部分代码:
#import <UIKit/UIKit.h>
%hook SBStatusBarManager
- (void) handleStatusBarTapWithEvent: (id)arg1{
[[UIApplication sharedApplication] launchApplicationWithIdentifier: @\"com.apple.mobilesafari\" suspended: NO];
%orig;
}
%end
在编译时给出错误:
Tweak.x:7:40: error: no visible @interface for \'UIApplication\' declares the selector \'launchApplicationWithIdentifier:suspended:\'
[[UIApplication sharedApplication] launchApplicationWithIdentifier: @\"com.apple.mobilesafari\" suspended: NO];
1 error generated.
make[3]: *** [/Users/deckard/test/.theos/obj/debug/armv7/Tweak.x.7f1f218f.o] Error 1
make[2]: *** [/Users/deckard/test/.theos/obj/debug/armv7/test.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [test.all.tweak.variables] Error 2
这个方法是我从http://www.iphonedevwiki.net/index.php/UIApplication 得到的。你能告诉我我的错误在哪里,或者这段代码不应该工作吗?谢谢!
标签: ios uikit jailbreak uiapplication theos