views:

115

answers:

1

I am getting a problem, while inserting an object into the main List.

[editContactList addObject:editcontacts];
[editObject.contactList insertObject:editContactList atIndex:0];//error as mutating method sent to immutable object
[editcontacts release];
+2  A: 

If you get that particular error, you don't actually have an NSMutableArray; you have an NSArray. Which is immutable. (Note that simply casting an NSArray to NSMutableArray does nothing, the array itself needs to be an instance of a mutable array, rarely seen with instance variables, especially those made accessible publicly.)

Edit: We're going to need some more information; how are these variables defined, how are they initialized, etc.

Williham Totland