iOS 基础类解析 - NSData

NSData Class Reference

Inherits from
NSObject
Conforms to
NSCopying

NSMutableCopying

NSSecureCoding

NSObject
(NSObject)

Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in iOS 2.0 and later.
Declared in
NSData.h

Companion guides
Binary
Data Programming Guide

Property
List Programming Guide

Related sample code

AdvancedURLConnections

CryptoExercise

EADemo

MVCNetworking

SimpleURLConnections

Overview

NSData and its mutable subclass NSMutableData provide
data objects, object-oriented wrappers for byte buffers. Data objects let simple allocated buffers (that is, data with no embedded pointers) take on the behavior of Foundation objects.

NSData creates static data objects, and NSMutableData creates
dynamic data objects. NSData and NSMutableData are typically used for data storage and are
also useful in Distributed Objects applications, where data contained in data objects can be copied or moved between applications.

The size of the data is subject to a theoretical limit of about 8 ExaBytes (in practice, the limit should not be a factor).

NSData is “toll-free bridged” with its Core Foundation counterpart, CFDataRef.
See “Toll-Free
Bridging”
 for more information on toll-free bridging.

Tasks

Creating Data Objects

Accessing Data

Base-64 Encoding

Testing Data

Storing Data


Copyright ? 2014 Apple Inc. All Rights Reserved. Terms of Use | Privacy
Policy
 | Updated: 2014-02-11

iOS 基础类解析 - NSData,布布扣,bubuko.com

时间: 2025-02-01 09:09:26

iOS 基础类解析 - NSData的相关文章

iOS 基础类解析 - NSObject

太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作. NSObject Class Reference Inherits from none (NSObject is a root class) Co

iOS 基础类解析 - NSDate

NSDate Class Reference Inherits from NSObject Conforms to NSCopying NSSecureCoding NSObject (NSObject) Framework /System/Library/Frameworks/Foundation.framework Availability Available in iOS 2.0 and later. Declared in NSDate.h Companion guides Date a

iOS 基础类解析 - NSNumber

NSNumber Class Reference Inherits from NSValue : NSObject Conforms to NSCopying (NSValue) NSSecureCoding (NSValue) NSObject (NSObject) Framework /System/Library/Frameworks/Foundation.framework Availability Available in iOS 2.0 and later. Declared in

iOS 基础类解析 - NSString

太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作. 以下从苹果官网摘录的 NSString 的目录信息,大家发现了,条目太多,不过看一下分类,一共24个,好像少很多了吧,就是这样,理解了每一个分类所

IOS 原生解析JSON 问题

服务器----WebService 返回的是JSON数据 IOS解析报错: Error Domain=NSCocoaErrorDomain Code=3840 "Unable to convert data to string around character 56." UserInfo={NSDebugDescription=Unable to convert data to string around character 56.} Code = 3840 错误 通过我将JSON写成

iOS中解析json多种方法

我感觉JSON解析,重要的是JSON解析之后对结果的处理JSON解析后是个dictionary,但是字典中有可能包含字典和数组,数组中还可以包含字典.向客户端请求的返回数据解析下面就简单介绍一下JSON解析过程其实就一句话 "data就是解析数据"!!!!!!!!!!!!!! //xcode自带解析类NSJSONSerialization从data中解析出数据放到字典中NSDictionary *weatherDic = [NSJSONSerialization JSONObjectW

iOS xml解析

iOS xml 解析方法有两种:SAX , DOM. SAX 不用借助第三方,在解析过程中逐行解析.(NSXMLParser,需要实现代理),具体步骤: 1.获取文件路径. 2.创建 NSXMLParser 对象. 3.遵守协议,设置代理. 4.实现代理方法 1>- (void)parserDidStartDocument:  ---- 开始解析 2>- (void)parserDidEndDocument: ----解析结束 3>- (void)parser:didStartEleme

iOS - Usage of NSData

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 = [N

iOS中解析 XML / JSON

JSON数据格式 1. 概述: JSON (JavaScript Object Notation) 是?一种轻量级的数据交换格式 基于?文本格式,易于?人阅读和编写,同时也易于机器解析和?生成. 2. JSON 数据的书写格式是:名称/值 • 名称写在前?面(在双引号中) • 值对写在后?面 • 中间?用冒号隔开 3. JSON 值?支持类型 数字(整数或浮点数) 字符串(在双引号中) 逻辑值(true 或 false) 数组(在中括号中) 对象(在花括号中) null JSON格式?一:最外层