Isn't NSMutableArray a subclass of NSArray in a few languages?
Basically inheritance is the wrong tool for this kind of stuff. NSMutableArray inherits from NSArray, so it can be passed to anywhere NSArray is expected (upcasting).
So you design your classes and expect them to be immutable, but you can't use NSArray anywhere. Because otherwise, it'll be mutable after all. You can do a runtime check as a workaround.
(I truly believe OOP should only be taught in computer science as a relic).
The problem is the "exclusive access to it", most language aren't Rust.. Some Ada-implementation has the problem ( https://news.ycombinator.com/item?id=43001394 )
Swift is completely different. Standard arrays are structures, always mutable - value types passed by value