Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different between NSData and NSMutableData in iPhone

What is the difference between NSData and NSMutableData?

like image 376
Mr.savaliya Avatar asked Mar 16 '13 06:03

Mr.savaliya


People also ask

What is NSData in iOS?

A static byte buffer that bridges to Data ; use NSData when you need reference semantics or other Foundation-specific behavior. iOS 2.0+ iPadOS 2.0+ macOS 10.0+ Mac Catalyst 13.0+ tvOS 9.0+ watchOS 2.0+

What is Data () in Swift?

Data in Swift 3 is a struct that conforms to collection protocol. It is a collection of bytes ( [UInt8] array of unsigned integer 8 bits 0-255).


1 Answers

From the Stack Overflow tag-wikis:

nsdata

The NSData class is an apple class for holding generic data. Often used when reading/writing from and to files, and the internet.

nsmutabledata

NSMutableData (and its superclass NSData) provide data objects, object-oriented wrappers for byte buffers.

like image 76
Danny Beckett Avatar answered Jan 03 '23 17:01

Danny Beckett