How to handle "mutating method sent to immutable object" exception?
- by Madan Mohan
I am having a class called Customer.
Customer *object; //in this object i have the following data varialbles.
object.customerName
object.customerAddress
object.customerContactList
I declared customerContactList as NSMutableArray and also allocated and initialized.
Now I am adding or deleting from contactList.
//Adding.
[object.customerContactList addObject:editcontacts];// here editcontacts one of the object in contactList.
//Deleting.
[object.customerContactList removeObjectAtIndex:indexPath.row];
[theTableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationFade];
I am getting exception even it is NSMutableArray. Please help me.
Thank You,
Madan Mohan