How do we clear out contents in NSMutableData

后端 未结 2 1125
Happy的楠姐
Happy的楠姐 2021-02-05 04:05

How do we clear an NSMutableData without using release and then re-alloc/init again to be used again? I was looking at resetBytesInRange to be set at zero but I am unsure of th

2条回答
  •  眼角桃花
    2021-02-05 04:18

    Swift version of the setting all the bytes to zero:

    data.resetBytes(in: NSRange(location:0, length:data.length))
    

提交回复
热议问题