I'm writing an iOS program in objective c and I need an array with the following characteristics:
1) It's shape needs to be decided at runtime.
2) It needs to be able to be stored as a property or a global inside an objective-c class
3) When I insert an object at a specific index it needs to stay at that index. For instance, if I insert at index 5, the object needs to overwrite whatever is at index 5 and do no shifting of this element or any other elements (Similar to how a java array works)
I've looked at NSMutableArray but that doesn't seem to fit what I'm describing above because it shifts elements as you insert. I've also tried NSString *myArray = malloc(10 * sizeof(NSString *)); but this gives me an error regarding requiring a bridged cast. And I don't know what that is.
I'm using ARC, in case that matters.