nszombies

Do system object delegates in ARC need to be set to nil?

痞子三分冷 提交于 2019-12-22 11:19:20
问题 An app crashes sometimes with error objc_object::release() . The Apple Developer Technical Support mentioned this: Remember that you should always do something like _tableView.delegate = nil; in your -dealloc methods, even if you are using ARC. For compatibility reasons system objects use unsafe_unretained references to implement delegation, instead of the preferred modern replacement weak . Does that mean that I have to set the delegates of system objects to nil when the view controller is

How can I set NSZombiesEnabled in XCode4?

£可爱£侵袭症+ 提交于 2019-12-10 16:45:34
问题 How can I enable NSZombiesEnabled in XCode4? I used to use this argument to debug EXC_BAD_ACCESS in XCode3. Not sure where to do it in XCode4. 回答1: Go to Executables of your application (Shown left side of your window) Expand it and double click on your application. Select Argument tab and insert NSZombiesEnabled and set its value to TRUE. (In second section) Here is the example too...Set NSZombiesEnabled 来源: https://stackoverflow.com/questions/6991328/how-can-i-set-nszombiesenabled-in-xcode4

Do system object delegates in ARC need to be set to nil?

断了今生、忘了曾经 提交于 2019-12-06 00:36:14
An app crashes sometimes with error objc_object::release() . The Apple Developer Technical Support mentioned this: Remember that you should always do something like _tableView.delegate = nil; in your -dealloc methods, even if you are using ARC. For compatibility reasons system objects use unsafe_unretained references to implement delegation, instead of the preferred modern replacement weak . Does that mean that I have to set the delegates of system objects to nil when the view controller is about to be released? class MyViewController: UIViewController { deinit { tableView.delegate = nil