0

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)
Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
  • Compiler isn't recognizing the ASObjC class. I've never even heard of ASObjC, but I would start by making sure the MSItems implementation file was imported and added to your build target. – emma ray Jul 23 '15 at 14:16
  • The MSItems implementation file should be the MSItems.applescript file, i.e. the ASObjC class. In Build Phases I see it's compiled, in Build Target I don't know to add it. – Matteo La Mendola Jul 23 '15 at 14:20

0 Answers0