与 AppKit 的链接问题
我已经使用 XCode3.2.1 创建了一个类,我想让它继承自 NSViewController (或任何其他 AppKit 实体)。
#import < Cocoa/Cocoa.h>
@interface myCustomView : NSViewController {}
@end
我已经链接到 Cocoa 库,但出现错误,它找不到类头文件
Undefined symbols: "_OBJC_CLASS_$_NSViewController", referenced from:
_OBJC_CLASS_$_myCustomView in myCustomView.o
我的项目中有其他类继承 Cocoa 类,没有问题。如果我让它继承属于 Framework 或 CoreData 的类(例如 NSObject、NSArray、NSEntityDescription),我不会出现任何错误。
有什么建议吗?
I've created a class using XCode3.2.1 and I want to make it inherit from NSViewController (or any other AppKit entity) .
#import < Cocoa/Cocoa.h>
@interface myCustomView : NSViewController {}
@end
I've linked in the Cocoa libraries, but I get the error that it can't find the class header file
Undefined symbols: "_OBJC_CLASS_$_NSViewController", referenced from:
_OBJC_CLASS_$_myCustomView in myCustomView.o
I have other classes in my project that are inherit Cocoa classes without a problem. I don't have any errors if I make it inherit from classes that are part of Framework or CoreData (eg NSObject, NSArray, NSEntityDescription).
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查您的子类
NSViewController
实现文件是否处于活动目标的“编译源”构建阶段。Check if your subclassed
NSViewController
implementation file is in the "Compile sources" build phase of your active target.不知何故,某些框架在 XCode 中变得断开连接。
如果您按住 Control 键单击 Frameworks 并选择 GetInfo,则会出现
框有一条破折号穿过它(意味着它被部分选中)。
再次单击它会为所有类别激活它。
Somehow the some of the Frameworks become disconnected in XCode.
Under if you control-click Frameworks and select GetInfo, it the
box had a dash through it (meaning it was partially selected).
Clicking it again activated it for all classes.