我正在尝试学习如何在此测试项目中使用桥接头。对于这一部分,我希望有一个方法可以接收并返回CGPoint数组。
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
@interface OpenCVWrapper : NSObject
+ (UIImage *)grayscaleImage:(UIImage *)image;
+ (UIImage *)gaussianBlurImage:(UIImage *)image;
+ (UIImage *)cannyEdgeImage:(UIImage *)image;
//Error says Expected a type
+ ([CGPoint *])lineEdges:([CGPoint *])points;
@end
因为我是新手,所以我什至不知道从哪里开始寻找问题。
答案 0 :(得分:0)
由于您需要返回CGPoint数组,因此您的数组应包含NSValue类型,因为该数组无法包含结构类型
...
path = getattr(aruco, dictionary)
...
,您应该将方法调用为
+ (NSArray<NSValue *> *)lineEdges:(NSArray<NSValue *> *)points;
返回值也应位于NSValue中并提取
NSArray *lineEdges = [OpenCVWrapper lineEdges:@[[NSValue valueWithCGPoint:CGPointMake(3.3, 4.4)]]];