首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未声明的标识符“MSHookIvar”

未声明的标识符“MSHookIvar”
EN

Stack Overflow用户
提问于 2016-01-05 23:04:34
回答 1查看 1.5K关注 0票数 1

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

代码语言:javascript
复制
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");

这是我的代码:

代码语言:javascript
复制
#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的定义,我该怎么办?

请帮帮忙

EN

回答 1

Stack Overflow用户

发布于 2016-01-06 23:25:29

我发现了来自googlecode用户networkpx Linksubstrate.h

我用我现在的版本替换了它,它似乎可以很好地编译和工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34614817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档