问题
i'm trying to implement this tweak using THEOS that calls another view on load
but i keep getting this error when i compile:Tweak.xm:13:57: error: class method '+onLeftMenu' not found (return type
defaults to 'id') [-Werror,-Wobjc-method-access]
[_logos_static_class_lookup$FoxTubeViewController() onLeftMenu];
my code Tweak.xm file:%hook MainViewController
- (void)viewDidLoad{
%orig;
[%c(LeftMenu) onCachedVideo];
}
%end
回答1:
if you need to use %c you should
#import "LeftMenu.h"
and if you don't want that you can call it from runtime using
#import <objc/runtime.h>
then call it like
[objc_getClass("LeftMenu") onCachedVideo];
GoodLuck
来源:https://stackoverflow.com/questions/26594145/theos-compiling-error-when-calling-method-in-other-class-logos