0

我在为 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 添加新变量吗?

非常感谢

4

1 回答 1

2

添加类别将修复它。

@interface UIKeyboardImpl (YourCategory)
@property(assign, nonatomic) BOOL showsCandidateInline;
@property(assign, nonatomic) BOOL showsCandidateBar;
@end
于 2011-11-02T15:44:34.683 回答