0

I have an MRC(Manual Reference Counting/non-ARC) project, and I have modified one class file to ARC compatible by adding "-fobjc-arc" compiler flag after these changes I'm getting an runtime error whenever I run the app like "message sent to deallocated instance crash"

If I remove the -fobjc-arc flag then my app works as expected, but with this flag it is throwing this run time exception. I did lot of googling, but of no luck. Any one faced this problem, any help is appreciated in advance.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Splendor_iOS
  • 217
  • 1
  • 3
  • 10
  • `message sent to deallocated instance crash` means the object is being deallocated, you will never find the solution for this on google, you have to dig into your code and find out which object is being deallocated and where/when. – Inder Kumar Rathore Apr 09 '15 at 12:47
  • 1
    Post your console log, and source code portion which causes this crash – vichevstefan Apr 09 '15 at 13:17
  • Hi @vichevstefan I have tried debugging with exception break points and zombie enabled, but still of no luck :( , every time Im getting "[XXXClassName tableView:heightForHeaderInSection:]: message sent to deallocated instance" exception, even if I comment out my tableview delegates I'm getting this exception Im debugging in Xcode 6.1 – Splendor_iOS Apr 10 '15 at 06:31
  • for now, it is very difficult to guess your reason, but to have understanding, please refer my question(I have recently experienced which seems like related to your question) http://stackoverflow.com/questions/29499833/object-deallocated-in-arc-mode – vichevstefan Apr 10 '15 at 06:49
  • Hi @vichevstefan, thanks for your valuable time and help, I will bang my head for some time in debugging and try to sort it out.. – Splendor_iOS Apr 10 '15 at 09:38

1 Answers1

0

That means that you are sending message to an instance that has been dealloacted, assuming by ARC.

To see which message and object is involved, you can add an exception breakpoint. Also using Instruments with Allocations tool may help with debugging.

Using Zombies as suggested by @Mephes is also a very good idea.

Seurahepo
  • 141
  • 4