Theos" make"错误:找不到类方法

时间:2015-01-09 01:29:46

标签: ios objective-c ios8 theos

我正在尝试使用Theos for iOS 8进行调整。它的约会包括在最后一个应用程序关闭时关闭应用程序切换器(当只剩下SpringBoard卡时)。这是完整的源代码(请不要注意UIKit / UIKit.h,我知道还必须有<>):


#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

当我尝试使用“make package install”命令编译它时,我收到此错误:

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) {

谢谢!

1 个答案:

答案 0 :(得分:0)

SBAppSwitcherIconController没有类方法' _appList'。您可以在此处查看标题: https://github.com/coolstar/iOS-8.1-SpringBoard-Headers/blob/master/SBAppSwitcherIconController.h

一个班级方法会有一个' +'在函数头前面。例如,SBAppSwitcherIconController有两个类方法(但不会对你的调整有所帮助):

+(浮点)nominalDistanceBetween5IconCentersForSize:(CGSize)大小;

+(浮点)nominalDistanceBetween3IconCentersForSize:(CGSize)大小;