创建 MobileSubstrate 调整时出现重复的接口声明错误

发布于 2024-12-13 05:31:33 字数 982 浏览 0 评论 0原文

我在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-12-20 05:31:33

添加类别即可解决此问题。

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

Adding a category will fix it.

@interface UIKeyboardImpl (YourCategory)
@property(assign, nonatomic) BOOL showsCandidateInline;
@property(assign, nonatomic) BOOL showsCandidateBar;
@end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文