I am trying to build an array that contains arrays of dictionary objects in Xcode. I can create a working array that has one or more dictionaries in it and then use the addObject: method to add this array as an object in my main array. I cycle around this several times, rebuilding the working array and adding objects to the main array. All good so far, except that on inspecting my main array it contains duplicates of the last dictionaries that the working array was built with. I am assuming this is because when I use the addObject it simply assigns a pointer to the array but does not increase the retain count or create a copy of the working array, hence every time it is rebuilt the main array simply points to the this array.
I guess my question is how do I create a copy of the working array add it to the main array and then rebuild it and add it again? Hope that makes sense and sorry if this appears to be a basic question - it is (I'm new to Xcode) - and any help would be really appreciated.