A memory leak is when an object or variable is not released after use, so what if we go another extreme? This causes the transition release problem to cause the object to "zombie", which is called a Zombie (Zombies) object. An object has been freed, or the caller does not have ownership of the object and releases it, causing the transition to be released, creating zombie objects.
Zombie objects may sound very scary to many people, also very unfamiliar, if you want to talk about exec_bad_access abnormalities, may be not unfamiliar to everyone. An attempt to invoke the Zombie object method application crashes (the application jumps directly) and throws an exception exec_bad_access.
Let's take a look at the code snippet Viewcontroller:
-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) Indexpath {Nsuinteg
Er row = [indexpath row];
Nsdictionary *rowdict = [Self.listteams objectatindex:row];
NSString *rowvalue = [rowdict objectforkey:@ "name"]; NSString *message = [[NSString alloc] initwithformat:@ "You chose the%@ team.
", Rowvalue]; Uialertview *alert = [[Uialertview alloc]initwithtitle:@ "Please select Team" Message:message delegate:self
uttontitle:@ "OK" otherbuttontitles:nil]; [Alert release];
①[message release]; [Alert show];
②[tableview Deselectrowatindexpath:indexpath Animated:yes]; }
Look at the bold part of the code, and you'll see what the problem is? The result of the program running throws a Exec_bad_access exception. Assuming we can't find the problem now, we can use the instruments tool's zombies trace template. Where instruments Select the Zombies template, click the Profile button to enter.