What is the difference between NSArray and Array ?
1 min readOct 5, 2021
NSArray
- NSArray is hold different types of data where you can store double, string, float, custom object etc.. or you can store element of different data types.
- NSArray is immutable. It means object state can’t be modified after it is created.
- It’s reference type. It means two variable point to the same address in memory so if you make change or perform operation in one variable , it will automatically reflect on another variable. Because both variable refer same object in memory.
Array
- Array is hold same types of data. It means at a time you can store only one type of data.
- Array is mutable. It means liable to change or object can be modified after it it is created.
- Array is value type. It means each variable has its own copy of data so operation on one variable can’t affect on the other variable of same array.