简体   繁体   English

使用AppKit链接问题

[英]Linking problems with AppKit

I've created a class using XCode3.2.1 and I want to make it inherit from NSViewController (or any other AppKit entity) . 我已经使用XCode3.2.1创建了一个类,我想让它继承自NSViewController(或任何其他AppKit实体)。

#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 我已经在Cocoa库中链接了,但是我得到了它无法找到类头文件的错误

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. 我的项目中有其他类继承Cocoa类没有问题。 I don't have any errors if I make it inherit from classes that are part of Framework or CoreData (eg NSObject, NSArray, NSEntityDescription). 如果我从作为Framework或CoreData一部分的类继承它(例如NSObject,NSArray,NSEntityDescription),我没有任何错误。

Any suggestions? 有什么建议么?

检查子类化的NSViewController实现文件是否处于活动目标的“编译源”构建阶段。

Somehow the some of the Frameworks become disconnected in XCode. 不知何故,某些框架在XCode中已断开连接。 Under if you control-click Frameworks and select GetInfo, it the box had a dash through it (meaning it was partially selected). 如果您按住Control键并单击Frameworks并选择GetInfo,则该框上有一个破折号(意味着它已被部分选中)。 Clicking it again activated it for all classes. 再次单击它会激活所有课程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM