My project is written in ApplescriptObjC and Objective-C. I have an NSTabViewDelegate, which must be written in ObjC:
#import <Cocoa/Cocoa.h>
#import "MSItems.h"
@interface MSTabView : NSTabView<NSTabViewDelegate>
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem;
@end
@implementation MSTabView
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem {
if ([[tabViewItem identifier] intValue] == 1) {
[MSItems myMethod];
}
}
@end
MSItems class is written in ApplescriptObjC, but I created a header file, which contains only the method I need to be called by other classes.
#import <Cocoa/Cocoa.h>
@class MSItems;
@interface MSItems : NSObject
+ (void) myMethod;
@end
In the ASObjC class i have:
script MSItems
property parent : class "NSObject"
on myMethod()
--stuff
end myMethod
end script
But the app doesn't compile and I get the error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MSItems", referenced from:
objc-class-ref in MSTabView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)