Interface Builder 选择了错误的头文件
我的项目中有两个名称完全相同的头文件,界面生成器似乎为“文件所有者”下拉列表选择了错误的头文件,我如何更改它以使用其他头文件?
谢谢。
I have two header files with EXACT same name in my project, it seems interface builder is picking the wrong one for "File Owner" dropdown, how can i change it to use the other header file?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理想情况下,您应该更改头文件之一的名称!
尽管您当然可以在项目中的不同文件夹中拥有相同名称的文件——并且在某些情况下,例如当您引入第三方库时,这种情况就会发生——您从 Interface Builder 引用的标头应该是作为 UI 部分,由您控制的一小部分。您应该只重命名其中一个类。
(也许有一种方法可以让 IB 脱颖而出,但即使有,这似乎也是一个脆弱的设置。)
Ideally, you should change the name of one of the header files!
Although you can certainly have same-named files in different folders within a project-- and in some cases, such as when you pull in third-party libraries, it'll just happen-- headers that you reference from Interface Builder should be a small subset that are under your control as your UI pieces. You should just rename one of the classes.
(There may be a way to get IB to differentiate, but even if there is, it seems like a fragile setup.)