Maison  >  Questions et réponses  >  le corps du texte

ios - 谁有研究过NSMutabelData中length与bytes的关系

1.length 是否为8bit为1个length
2.bytes是否和length相等
3.如果第一个问题成立那么一个lenth的意义或者代表的什么意思,为什么不用length取代bytes
4.bytes存在的意义

怪我咯怪我咯2729 Il y a quelques jours624

répondre à tous(1)je répondrai

  • PHPz

    PHPz2017-04-17 18:01:29

    length 是个 NSUInteger 型的数据,表示的是 data 的长度, bytes 是个指针,指向 data 的内容。不存在相等不相等,能不能相互替换的问题。

    @property(readonly) NSUInteger length
    The number of bytes contained by the data object.
    
    
    @property(readonly) const void *bytes
    A pointer to the receiver’s contents. 
    

    répondre
    0
  • Annulerrépondre