How do I convert an NSNumber to NSData?

前端 未结 4 658
鱼传尺愫
鱼传尺愫 2020-12-31 03:37

I need to transmit an integer through GameKit using sendDataToAllPeers:withDataMode:error: but I don\'t know how to convert my NSNumber to NSData in order to se

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 04:35

    For a more detailed example how to send different payloads you can check the GKRocket example included in the XCode documentation.

提交回复
热议问题