I need to interface with some C++ code. I can readily make an Objective-C++ 
class file and access that class from Swift. But I'd like to instead make a 
Swift class, and just put some additional method definitions in a .mm file. 
However, the Swift compiler doesn't see those.

So, I realized it needed to be in the bridging header. I created the following 
(in target "ModelShop"):

-----------------------
Job+Bridge.h:
-----------------------
#import <AppKit/AppKit.h>
#import "ModelShop-Swift.h"

@interface Job(Bridge)

- (void)                processSomething;

@end
-----------------------
Job+Bridge.mm:
-----------------------
#import "Job+Bridge.h"

@implementation Job(Bridge)

- (void)
processSomething
{
}

@end
-----------------------
ModelShop-Bridging-Header.h:
-----------------------
#import "EOSManifest.h"
#import "ModelMesh.h"

#import "Job+Bridge.h"
-----------------------

Unfortunately, it doesn't like #import "ModelShop-Swift.h" in the header. It 
complains:

Job+Bridge.h:5:9: 'ModelShop-Swift.h' file not found
Failed to import bridging header 'ModelShop/ModelShop-Bridging-Header.h'

Is there any way to do what I want without having to make a completely separate 
class declaration, or implement the entire class in Obj-C++?

Thanks,

-- 
Rick Mann
rm...@latencyzero.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to