我有类似的问题
创建Objective C Wrapper类MeshHolder.hh
#import <Foundation/Foundation.h>
#include "Sculpt.h"
NS_ASSUME_NONNULL_BEGIN
@interface MeshHolder : NSObject
-(void) setupMesh:(Mesh_CPP *)mesh;
-(Mesh_CPP *)getMesh;
@end
NS_ASSUME_NONNULL_END
和 .MM 文件
#import "MeshHolder.hh"
@implementation MeshHolder
Mesh_CPP * meshTEMP_;
-(void) setupMesh:(Mesh_CPP *)mesh {
meshTEMP_ = mesh;
}
-(Mesh_CPP *)getMesh {
return meshTEMP_;
}
@end
如何使用它
@property(strong,nonatomic) NSMutableArray<MeshHolder*> *arrMeshes;
MeshHolder *meshH = [MeshHolder new];
[meshH setupMesh:meshTemp];
[_arrMeshes addObject:meshH];
希望它作为一个快速示例有所帮助