ARC converts the application with the last call .cxx_destruct

Below is a trace of the thread stack of my application that crashed. I recently converted my application to ARC. The final call is the cxx_destruct HomePageViewController, which is the rootviewcontroller of one of my tabs in the tabviewcontroller. The appdelegate implementation file is not supported by ARC for compilation, so the HomePageViewController is freed up after it is added to the tabbarviewcontroller in the appdelegate file. The HomePageViewController implementation file has an ARC flag for compilation. Can anyone lead me in the right direction

0 libobjc.A.dylib 0x35bcdf2a objc_release 1 MySample 0x00096142 -[HomePageViewController .cxx_destruct] + 402 2 libobjc.A.dylib 0x35bcff3a object_cxxDestructFromClass(objc_object*, objc_class*) 3 libobjc.A.dylib 0x35bcd0ce objc_destructInstance 4 libobjc.A.dylib 0x35bcd3a2 object_dispose 5 UIKit 0x37b05c84 -[UIViewController dealloc] 6 MySample 0x00095afa -[HomePageViewController dealloc] + 218 7 libobjc.A.dylib 0x35bcd484 8 CoreFoundation 0x3801343c _CFAutoreleasePoolPop 9 UIKit 0x37a46d94 _wrapRunLoopWithAutoreleasePoolHandler 10 CoreFoundation 0x380a56ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ 11 CoreFoundation 0x380a39bc __CFRunLoopDoObservers 12 CoreFoundation 0x380a3d12 __CFRunLoopRun 13 CoreFoundation 0x38016eb8 CFRunLoopRunSpecific 14 CoreFoundation 0x38016d44 CFRunLoopRunInMode 15 GraphicsServices 0x35ccc2e6 GSEventRunModal 16 UIKit 0x37a8e2fc UIApplicationMain 17 MySample 0x0002be98 main + 116 18 MySample 0x0000315c start + 
+4
source share
1 answer

The comment above is correct; you seem to manually call release on this view controller, which is prohibited by ARC. Just delete this call and you should be fine.

Also, why did you exclude the application delegate from ARC? In this class, there should not even be much code except the main core, if you use Core Data ...

0
source

Source: https://habr.com/ru/post/1435879/


All Articles