Car class
--------------
price
color
crash code is:
NSMutableArray *list = [[NSMutableArray alloc] init];
Car *car = [[Car alloc] init];
car.price = 10;
car.color = 1;
[list addObject:car];
// some code
[list removeAllObjects]; // Crash here
why crash, how can i resolve it.
app exit with nothing output
I dont know what you have in the “someCode” section in your segment. You first comment out that code and check if the app crashes. If still it crashes then only consider what I have given below. I mean you make sure there is nothing wrong with your code before going for workarounds 🙂
just try this code, and see if it crashes now.I know it doesn’t make sense, but it happened to me once too. Once when array count was zero removeAllObjects crashed for me. I doubt an SDK bug somewhere there 🙁