1

It's a weird situation for me that I cannot run my project on device or emulator but when I choose profile instead of run option, the app run flawlessly without any zombie guys.

It happens after I convert my project to ARC. I just modify code as Xcode tell me todo and due to the size of this project, I cannot look through every line of code.

ps. I'm the third hand on this application, so it's almost impossible for me to understand 10k lines of code.

OffCS
  • 441
  • 3
  • 15
  • *It happens after I convert my project to ARC. I just modify code as Xcode tell me todo and due to the size of this project, I cannot look through every line of code.* -- despite the fact that it is automated, there are still huge changes involved. you should expect and reserve some time for bumps, side-effects, and bugseeking. of course, that doesn't mean you need to understand 10KSLOC, just that migration can take time. – justin Sep 06 '12 at 21:53
  • Thank you. Currently, I'm look through some code and found that my last effort fails because the 3rd party libraries. – OffCS Sep 11 '12 at 11:07

2 Answers2

2

Have you tried enabling Zombies in Xcode itself without profiling? This will set objects to never dealloc so that when you message an object that has a zero retain count, it will know what the object is and tell you. Just make sure you turn it on again so that objects will dealloc as normal.

See how to do that here: How to enable NSZombie in Xcode?

Community
  • 1
  • 1
brynbodayle
  • 6,546
  • 2
  • 33
  • 49
0

the following can help you after the fact, but it's best IMO to perform them before migration; if a problem exists, ARC will solve some issues while abstracting others from you:

1) Create more Autorelease Pools one approach which might help you narrow things down is to explicitly create autorelease pools -- this can help localize some of your app's memory related issues. explicitly adding autorelease pools has other benefits, so this can be done not only for bug-seeking.

2) Use GuardMalloc as well, there are other memory related tools -- your app should also run fine with GuardMalloc enabled. switching to ARC could change the point of destruction -- you may be holding on to a dangling pointer.

3) Remove all Leaks finally, this may sound backwards -- remove all leaks possible. you want memory operations and lifetimes well defined. if you have an occasional leak, your issue could be hard to detect. oftentimes, reducing leaks can help you isolate the problem by making the problem easier to reproduce.

justin
  • 104,054
  • 14
  • 179
  • 226