Instruments show leak in main.m (Xcode 4.3.1)

我的未来我决定 提交于 2019-11-29 01:28:11

It seems to be a bug in the iOS 5.1 framework: https://devforums.apple.com/message/630695

I had this same problem while using ARC and it was caused by having the dealloc function in a view controller. By having the dealloc function (that didn't do anything in my case), the default behavior may not be called. Try commenting out all instances of dealloc and that should fix your problem.

Your main.m looks different than others I have seen. Did you format it that way or was it done that way automatically? Here is an example from one of my ARC apps.

int main(int argc, char *argv[]) {

    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, nil);
        return retVal;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!