سؤال

My apps start crashing after upgrading to iOS 5 with Xcode 4.2. Otherwise the same source is validated working in iOS 4.3. I am quite clueless about what might have occurred since the backtrace did not reveal much info. Here is what I can say about the behavior of the crash: -

  1. The backtrace revealed the last attempt to free memory resource from the automatic pool which triggers the EXC_BAD_ACCESS signal.

  2. The problem disappeared after setting the env. variable NSZombieEnabled. This is all very sad, I was hoping that NSZombieEnabled could reveal the attempt to release deallocated instance.

When migrating source to iOS 5, do I need to take extra precaution, having to make modification to my Obj-C source to suit iOS 5? At this moment I have not make any enhancement to the source to take additional features in iOS 5.

I read something about ARC, do you think ARC may be able to cause new crashes never seen in prior versions of iOS?

Any tips and advice about migrating existing source to iOS5 is appreciated.

هل كانت مفيدة؟

المحلول

As it turned out the UITableViewCell* as returned by tableView:cellForRowAtIndexPath: needs to be retained manually (nope I did turn on the ARC).

I am loading custom nib files manually and followed Apple's sample code religiously at this link

I still do not understand why I need to retain it. I have several other tables in my apps which do not retain the returned cell and yet functioning as usual in iOS5.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top