为了调用函数,我使用data.withUnsafeBytes( { (ptr: UnsafePointer<UInt8>) in ...}将数据转换为c函数,它运行良好。在将Xcode升级到swift5之后,我现在得到一个不推荐的警告。/ Create sample data (Typically would be read from a file
data.withUnsafeBytes
我需要在J2Objc中的objective头中调用以下API。 * Create a new array of a specified length, setting the elements to the values in buf.class IOSByteArray: NSObject {+ (instancetype)newArrayWithBytes:(const jbyte *)buf count:(NSUInteger)count;}func myFunc() -> IOSByteArray {