iOS - Usage of NSData
2024-08-28 06:16:52
Reference link : https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/BinaryData/Tasks/WorkingBinaryData.html
1. create NSData, here msgData is also a NSData:
const Byte * data = (const Byte *)[msgData bytes];
heartbeat.rawData = [NSData dataWithBytes: data length: [msgData length]];
2. Compare two NSData
// if value not changed
if([model.rawData isEqualToData:(NSData*)msgData])
{
return FALSE;
}
最新文章
- Scrapy创建zentao爬虫
- mysql服务器和配置优化
- JPush API client library for C Sharp(极光推送API)
- JAVA CDI 学习(4) - @Alternative/@Default/@Any &; Extension
- locality
- 必须关注的25位知名JavaScript开发者
- oracle限制用户连接数
- USACO Section 2.2 循环数 Runaround Numbers
- 跟我一起学习ASP.NET 4.5 MVC4.0(五)(转)
- iOS Core data多线程并发访问的问题
- HBase-java api 基本操作
- mysql求时间差
- Arduino 入门程序示例之一片 LED(2015-06-11)
- Java 编码 字符集
- RobotFramework自动化测试框架-移动手机自动化测试Click Element关键字的使用
- lesson - 11 正则表达式
- 深入学习MySQL事务:ACID特性的实现原理
- selenium+java二元素定位
- IDEA 介绍
- 如何写更少的 if else