I've imported a 'TestCPP.cpp' file into my Swift project and wrote a wrapper for the formula I want to call from a Swift program. The program compiles just fine and within 'main.swift' the formula autocompletes and I can see the definition properly under "quick help"
The problem is I get the error "Extra argument in call." To try and backtrack the error I started going parameter by parameter and get errors that say "Cannot convert value of type 'Double' to expected argument type 'TestObjC' ". This doesn't make sense as I built 9 parameters, the first 6 are doubles and last 3 are strings and that's what I've input into the function in the swift file.
Anyone have any idea why I'm getting these errors and how to fix them?
main.swift
let test = TestObjC.TestCPP(200.00,210.00,0.25,0.15,0.0025,0.02,"alpha","bravo","charlie")
Bridging Header file
#import "TestObjC.h"
TestObjC.h
#import <Foundation/Foundation.h>
@interface TestObjC : NSObject
- (double) TestCPP: (double) A : (double) B : (double) C :(double) D : (double) E : (double) F : (NSString*) Caller : (NSString*) Sector : (NSString*) OutPut;
@end
TestObjC.mm
#import “TestObjC.h”
#import “TestCPP.h"
@interface TestObjC(){
Test wrapped;
}
@end
NSString *Caller = Caller;
string Call = [Caller UTF8String];
NSString *Sector = Sector;
string Sect = [Sector UTF8String];
NSString *OutPut = OutPut;
string OP = [OutPut UTF8String];
@implementation TestObjC
- (double) TestCPP: (double) A : (double) B : (double) C :(double) D : (double) E : (double) F : (NSString*) Caller : (NSString*) Sector : (NSString*) OutPut;
@end
return wrapped.TesterFunction((double) A, (double) B, (double) C, (double)D, (double)E, (double) F, Call, Sect,OP);
}
@end