草庐IT

TestCppClass

全部标签

c++ - Swift - 使用 Objective-C 包装器调用 C++ 文件 - 传递 Int 值

我正在尝试从Swift项目调用C++方法。我用了this设置和获取字符串值的教程,效果很好。然后我尝试对整数值执行相同的操作,但在我的objective-c包装器类中遇到了一些问题。#import#import"TestCppClassWrapper.h"#include"TestCppClass.h"@interfaceTestCppClassWrapper()@propertyTestCppClass*cppItem;@end@implementationTestCppClassWrapper-(instancetype)initWithTitle:(NSString*)title