我正在尝试对Theos for iOS 8进行一些调整。它的约会包括关闭最后一个应用程序时关闭应用程序切换器(当只有SpringBoard卡时)。下面是完整的源代码(请不注意对UIKit的/ UIKit.h,我知道,还必须有<>):Theos“make”error:class method not found
#import UIKit/UIKit.h
@interface SBAppSwitcherIconController {
NSMutableArray *_appList;
}
@end
@interface SBAppSwitcherController
- (void)_quitAppWithDisplayItem:(id)arg1;
//custom method
- (void)_dismissAppSwitcher;
@end
@interface SBUIController
+ (id)sharedInstance;
- (void)dismissSwitcherAnimated:(_Bool)arg1;
@end
%hook SBAppSwitcherController
- (void)_quitAppWithDisplayItem:(id)arg1 {
%orig();
if ([[%c(SBAppSwitcherIconController) _appList] count] == 0) {
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(_dismissAppSwitcher) userInfo:nil repeats:NO];
}
}
%new
- (void)_dismissAppSwitcher {
[[%c(SBUIController) sharedInstance] dismissSwitcherAnimated:YES];
}
%end
当我尝试用“让包安装”进行编译命令,我得到这个错误:
Tweak.xm:38:65: error: class method '+_appList' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
if ([[_logos_static_class_lookup$SBAppSwitcherIconController() _appList] count] == 0) {
谢谢!
好吧,那么,你可以告诉我,如何从SBAppSwitcherController的SBAppSwitcherIconController的_appList的 - (void)_quitAppWithDisplayItem ...? – vanelizarov