[Uiactivityindicatorview _applicationdidenterbackground:]: Message sent to deallocated instance
When we run my app, the app won't crash, but when we press the home button or lock the screen, the app will crash and zombie can capture the information. From the information available, the app sends a message to a Uiactivityindicatorview that has been released, causing crash. Finally check that the original is the use of the third-party package uikit+afnetworking caused by,
Again UIACTIVITYINDICATORVIEW+AFNETWORKING.M, there is the following code,
-(void) dealloc
{
nsnotificationcenter *notificationcenter = [nsnotificationcenter Defaultcenter];
#if __iphone_os_version_min_required >= 70000
[Notificationcenter removeobserver:selfname : afnetworkingtaskdidcompletenotification Object:nil];
[Notificationcenter removeobserver:selfname: Afnetworkingtaskdidresumenotificationobject:nil];
[Notificationcenter removeobserver:selfname : afnetworkingtaskdidsuspendnotification Object:nil];
#endif
[Notificationcenter removeobserver:selfname: Afnetworkingoperationdidstartnotificationobject:nil];
[Notificationcenter removeobserver:selfname : afnetworkingoperationdidfinishnotification Object:nil];
}
It is obvious that when the app goes backstage, Uiactivityindicatorview is released, and when this method is executed, the app is crash.
If you introduce uikit+afnetworking, no use of uiactivityindicatorview+afnetworking, big can remove him, so you can solve the above problem.
Hope to be of help to everyone.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
[Uiactivityindicatorview _applicationdidenterbackground:]: Message sent to deallocated instance