I'm trying to store NSMutableArray inside NSMutableArray. So
var all:NSMutableArray = NSMutableArray()
let localArray:NSMutableArray = NSMutableArray()
var i = 0
for ..........{
/* Add objects to localArray */
localArray.addObject("1\(i)")
/* Add localArray to all Array */
all.addObject(localArray)
/* Reset the array after adding to `all` array */
localArray.removeAllObjects()
i+=1
}
But the result: variable all which is NSMutableArray is reseted.
allto one array and emptying it each time through the loop. Tryprint(all)when you exit the loop to see what's happening.