NSData from UInt8

前端 未结 3 1268
心在旅途
心在旅途 2020-12-18 23:40

I have recently found a source code in swift and I am trying to get it to objective-C. The one thing I was unable to understand is this:

var theData:UInt8!

         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 00:23

    In Swift 3

    var myValue: UInt8 = 3 // This can't be let properties
    let value = Data(bytes: &myValue, count: MemoryLayout.size)
    

提交回复
热议问题