What is the difference between NSData and NSMutableData?
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+
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With