【问题标题】:Duplicate interface declaration errors when I create MobileSubstrate tweaks创建 MobileSubstrate 调整时出现重复的接口声明错误
【发布时间】:2011-11-02 15:09:47
【问题描述】:

我在针对 iOS 5 进行 Mobile Substrate 调整时遇到问题。

大多数关于 Cydia 调整的教程都有这个步骤:“下载私有框架头文件”。 所以,我从https://github.com/kennytm/iphone-private-frameworks下载了它

由于私有框架是从 iOS 3.x 转储的,一些新的方法和变量没有包括在内。

因此,我将这些变量添加到我的 Tweak.xm 中。我也导入了私有框架头文件。

例如:

#import "/opt/theos/include/UIKit/UIKit2.h"
#import "/opt/theos/include/UIKit/UIKeyboardLayoutStar.h"

@interface UIKeyboardImpl : UIView
@property(assign, nonatomic) BOOL showsCandidateInline;
@property(assign, nonatomic) BOOL showsCandidateBar;
@end

但是,当我编译调整时,我得到了这些错误:

Tweak.xm:45: error: duplicate interface declaration for class ‘UIKeyboardImpl’
Tweak.xm:45: error: redefinition of ‘struct UIKeyboardImpl’
Tweak.xm:45: error: trying to finish struct, but kicked out due to previous parse errors

我该如何解决这个问题? 我应该编辑 iOS 3 的私有框架头文件并从 iOS 5 添加新变量吗?

非常感谢

【问题讨论】:

    标签: iphone ios cydia


    【解决方案1】:

    添加一个类别将解决它。

    @interface UIKeyboardImpl (YourCategory)
    @property(assign, nonatomic) BOOL showsCandidateInline;
    @property(assign, nonatomic) BOOL showsCandidateBar;
    @end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-16
      • 1970-01-01
      • 1970-01-01
      • 2019-03-11
      • 1970-01-01
      • 2016-06-01
      相关资源
      最近更新 更多