2015-01-09 70 views
0

我正在尝试对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) { 

谢谢!

回答

0

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

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

+(float)nominalDistanceBetween5IconCentersForSize:(CGSize)size;

+(float)nominalDistanceBetween3IconCentersForSize:(CGSize)size;

+0

好吧,那么,你可以告诉我,如何从SBAppSwitcherController的SBAppSwitcherIconController的_appList的 - (void)_quitAppWithDisplayItem ...? – vanelizarov

相关问题