Theos编译报错,调用实例变量不知道怎么写

#import "Coin.h" %hook GetCoinController -(void)buttonT:(id)arg1 { %orig; NSLog(@"%@",con);//这里编译提示use of undeclared identifier con } %end
Coin.h里是这样
`@interface GetCoinController
{
NSMutableArray *con;
}

  • (void)initcon;
    @end`
    objectc 里调用实例变量直接写名字就可以的吧,请教这怎么写

这个貌似是oc的基础吧。
con是property?你试试self.con 或者 _con。

不是property,self.con 提示:
Tweak.xm:6:19: error: property ‘con’ not found on object of type
'GetCoinController '; did you mean to access instance variable
‘con’?
提示使用self->con,使用后提示
Undefined symbols for architecture armv7:
OBJC_IVAR$_GetCoinController.con”, referenced from:
_logos_method$_ungrouped$GetCoinController$viewDidLoad(GetCoinController
, objc_selector*) in Tweak.xm.9b76d7ea.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

在线等,挺着急的:no_mouth:

还在等 挺急的,顺便问下能不能开通个付费提问功能啊,我愿意付费提问

问题已经解决,在帖子

中有一段NSMutableArray *allReposts = MSHookIvar<NSMutableArray *>(self, “list”);这样调用即可

1 个赞

学习了。。。。