【问题标题】:Undeclared Identifier 'MSHookIvar'未声明的标识符“MSHookIvar”
【发布时间】:2016-04-09 11:06:15
【问题描述】:

导入substrate.h 后,我继续在挂钩类的函数中使用MSHookIvar。 顺便说一句,我正在尝试从 Cygwin 编译。 我无法编译并出现以下错误:

Tweak.xm:20:16: error: use of undeclared identifier 'MSHookIvar'
    hookedLabel = MSHookIvar<UILabel *>(self, "_textLabel");
                  ^
Tweak.xm:20:27: error: unexpected interface name 'UILabel': expected expression
    hookedLabel = MSHookIvar<UILabel *>(self, "_textLabel");
                             ^
Tweak.xm:20:36: error: expected expression
    hookedLabel = MSHookIvar<UILabel *>(self, "_textLabel");
                                      ^
Tweak.xm:20:38: error: expression result unused [-Werror,-Wunused-value]
    hookedLabel = MSHookIvar<UILabel *>(self, "_textLabel");

这是我的代码:

#import <UIKit/UIKit.h>
#import "substrate.h"
#import "logos/logos.h"

%hook DataView

UILabel *hookedLabel;

-(void)layoutSubviews {
    UILongPressGestureRecognizer *lpg = [[UILongPressGestureRecognizer alloc] initWithTarget: self action:@selector(handleLongPress)];
    [lpg setDelegate:self];
    [lpg setMinimumPressDuration:1];
    [self addGestureRecognizer:lpg];

    hookedLabel = MSHookIvar<UILabel *>(self, "_textLabel");
}

%end

我尝试导入logos.h,但它仍然没有任何帮助。

编辑: 我意识到我的substrate.h 没有MSHookIvar 的定义,我该怎么办?

请帮忙

【问题讨论】:

    标签: ios objective-c cygwin theos cydia-substrate


    【解决方案1】:

    我从 googlecode 用户 networkpx 中找到了 substrate.h Link

    我用我现在的替换了它,它似乎可以完美地编译和工作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-30
      • 1970-01-01
      • 2021-06-07
      • 2020-12-09
      • 2016-04-22
      • 2012-12-10
      相关资源
      最近更新 更多