swift中uint8_t的等价物是什么?

时间:2015-07-26 10:44:18

标签: c++ objective-c swift type-conversion

在obj-c / c ++框架中有一个方法,它采用 uint8_t 和常规 int

- (bool)push:(uint8_t *)buf length:(int)len;

我使用了一个bridger文件来访问此方法,但是当我使用 UInt8 Int 在swift中调用它时,我收到以下错误:

无法使用类型为'(UInt8,length:Int)'的参数列表调用'push'

我怎样才能让它发挥作用?

1 个答案:

答案 0 :(得分:3)

该方法需要一个指向# Try not to use `` anymore, backticks are hard to read stat=$(curl -Is $url | head -n 1) # When debugging, use some sort of delimiter which shows leading or trailing whitespace echo "<$stat>" # Variables inside [[ don't need to be quoted # Adding a trailing * allows optional trailing characters if [[ $stat == "HTTP/1.1 200 OK"* ]];then echo "$symbol is OK" echo $stat $(( valide++ )) # You don't need the "$", just the variable name else echo "$symbol is 404" echo $stat $(( err++ )) # using a $ in (( )) can change the scan sequence fi 类型和UInt8值元素数组的指针。你可以这样做:

Int32

请查看指针应如何处理:https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html