THEOS: compiling error when calling method in othe

2019-09-04 12:26发布

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条回答
你好瞎i
2楼-- · 2019-09-04 12:50

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

查看更多
登录 后发表回答