创建 MobileSubstrate 调整时出现重复的接口声明错误
我在为 iOS 5 进行 Mobile Substrate 调整时遇到问题。
大多数有关 Cydia 调整的教程都有此步骤:“下载私有框架标头”。 所以,我从以下位置下载了它: https://github.com/kennytm/iphone-private-frameworks< /a>
由于私有框架是从 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 中的新变量吗?
多谢
I have a problem about making Mobile Substrate tweaks for iOS 5.
Most tutorial about making Cydia tweaks have this step: "Download private framework headers".
So, I downloaded it from : https://github.com/kennytm/iphone-private-frameworks
Since the private-frameworks are dumped from iOS 3.x, some new methods and variables are not included.
Therefore, I added these variables to my Tweak.xm. And I imported the private-framework-headers too.
For example:
#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
However, when I compile the tweak, I got these errors:
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
How can I do to fix this problem ?
Should I edit the private framework headers of iOS 3 and add new variables from iOS 5?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加类别即可解决此问题。
Adding a category will fix it.