NSExecption while trying to delete a row in UITableView?

When you're trying to delete the object, your basketArray is not actually an NSMutableArray, as you can see in the exception. It is an NSArray, which does not respond to removeObjectAtIndex: If you expect basketArray to be mutable, check where you're making it mutable and make sure it's actually being performed.

When you're trying to delete the object, your basketArray is not actually an NSMutableArray, as you can see in the exception. It is an NSArray, which does not respond to removeObjectAtIndex:. If you expect basketArray to be mutable, check where you're making it mutable and make sure it's actually being performed.

I agree with you but the basketArray is mutable, but I think it is having problem in initialization and I could not solve it. – Zeshan Aziz Jul 28 at 17:00 if you're assigning a value retrieved from your JSON deserializer to basketArray it's NOT mutable. And you're also leaking the mutable array you already assigned to basketArray.

– Paul Tiarks Jul 28 at 18:00 yes I am retrieving the values from JSON deserializer to basketArray. So can you tell me how to make these values mutable? – Zeshan Aziz Jul 29 at 10:01 Thank you very much Paul , JSON Deserializer values were immutable, to make them mutable I copy my values to another array (mutable array).

NSMutableDictionary * dict = CJSONDeserializer deserializer deserializeAsDictionary:jsonData error:&error; if (dict) { // basketArray = NSMutableArray arrayWithCapacity:10; basketArray = NSMutableArray alloc init; NSArray *dictArray = NSArray alloc init; dictArray = dict objectForKey:@"myCartItems" retain; basketArray= dictArray mutableCopy; and this works fine – Zeshan Aziz Jul 29 at 10:33.

BasketArray = NSMutableArray alloc initWithObjects:nil; basketArray = dict objectForKey:@"myCartItems" retain; You alloc the array and then immediatly set it to what ever object your getting from that dictionary. I think what is happening is the object you are grabbing out of the dictionary is actually an nsarray. Try instead of those two lines basketArray = NSMutableArray arrayWithArray:dict objectForKey:@"myCartItems".

Return the number of rows in the section. // Customize the appearance of table view cells. // Override to support conditional editing of the table view.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions