简体   繁体   中英

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) .

#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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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