如何在Swift中声明一个C数组?

时间:2017-08-03 10:04:23

标签: c arrays swift

在OC中:

@interface ViewController ()
{
    int items[3];
}

在斯威夫特:

class ViewController: UIViewController {
    // ???...
}

我这样做:

class ViewController: UIViewController {
    var fuItems: [Int32] = []
}

但是在函数下方会返回错误:

- (CVPixelBufferRef)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer withFrameId:(int)frameid items:(int*)items itemCount:(int)itemCount flipx:(BOOL)flip;

错误:

Cannot convert value of type '[Int32]' to expected argument type 'UnsafeMutablePointer<Int32>!'
你可以帮帮我吗?谢谢!

0 个答案:

没有答案