如何将unsafemutablepointer <unsafemutablepointer <int8 >>转换为unsafemutablepointer <int8>!

时间:2019-01-23 16:54:38

标签: c swift

这是我主要的swift文件内容:

import Foundation

let argc = CommandLine.argc
let argv = UnsafeMutableRawPointer(CommandLine.unsafeArgv)  
        .bindMemory(  
            to: UnsafeMutablePointer<Int8>.self,  
            capacity: Int(CommandLine.argc)
        )

trialFunc(argc, argv)   <-- error in this line

我的.h文件包含

void trialFunc(int argc, char *argv);

我的.c文件包含

void trialFunc(int argc, char *argv)
{
// Some code
}

Bridging标头包含我的.h文件的include语句。

我从swift调用trialFunc的错误是

  

无法将类型UnsafeMutablePointer<UnsafeMutablePointer<int8>>的值转换为预期的参数类型UnsafeMutablePointer<int8>!

0 个答案:

没有答案