I have an NSMutableArray (detailsMA)having 100 strings like @”True”.
Am storing that array in NSMutableDictionary which is already allocated.
NSArray *array1 = [[NSArray alloc] initWithArray:detailsMA];
[detailsDictionary setObject: array1 forKey:@"detailsMA"];
Now i changed the values of detailsMA, like replacing strings to @”False”, After that am retrieving the original array values,
[detailsMA removeAllObjects];
[detailsMA addObjectsFromArray:[detailsDictionary objectForKey:@"detailsMA"]];
Here am getting modified values, not the original values.
I need original values.
Please help me.
You should copy the array.
Don’t forget to implement the NSCopying protocol in the classes for the objects to be copied
EDIT:
When you add the objects again, make a copy before adding.