Reputation: 259
What is the difference between NSData and NSMutableData?
Upvotes: 5
Views: 1874
Reputation: 7698
NSData
is fixed after creation.
NSMutableData
, as the name implies, allows operations that change the contents (appendBytes:
, appendData
, setData:
...).
Upvotes: 3
Reputation: 20768
From the Stack Overflow tag-wikis:
The NSData class is an apple class for holding generic data. Often used when reading/writing from and to files, and the internet.
NSMutableData (and its superclass NSData) provide data objects, object-oriented wrappers for byte buffers.
Upvotes: 3