Stop ARC releasing an object while it is idle

前端 未结 3 804
梦如初夏
梦如初夏 2021-01-17 00:29

I am having a problem with memory management in objective C. Ive been reading through the Advanced Memory Management Programming Guide but I cannot find a solution to my pro

3条回答
  •  梦毁少年i
    2021-01-17 00:57

    Your controller is getting dealloc'ed when the detailViewController is dealloc'ed. Hence, you must move the handle of your controller and define in it the any of the following :

    1. MasterViewController or your application's RootViewController OR
    2. AppDelegate OR
    3. Create a singleton as answered by "trojanfoe"

提交回复
热议问题