开发者

How to avoid " FREED(id): message cover sent to freed object=0x398b8f0"

开发者 https://www.devze.com 2023-01-02 18:44 出处:网络
I have this code: (void)viewDidLoad { Mo开发者_如何学运维MagAppDelegate *delegate = (MoMagAppDelegate *)[[UIApplication sharedApplication] delegate];

I have this code:

(void)viewDidLoad {
  Mo开发者_如何学运维MagAppDelegate *delegate = (MoMagAppDelegate *)[[UIApplication sharedApplication] delegate];
  self.issueList = delegate.issueList; //Line to error
  NSLog(@"IssueList size %d",[self.issueList count]);
  [super viewDidLoad];
}

Please suggestion for resolve this problem.


Somewhere your object (possibly issueList?) is freed prior to sending the message. And the release code is not in the scope of the code you posted. You can try to set an environmental variable called NSZombieEnabled. (Google around or try this http://www.fromconcentratesoftware.com/2007/08/09/nszombieenabled-for-the-debugger-adverse/ ) If I recall correctly, what this does is when you call release on an object, it doesn't actually get freed, ever. And when a supposedly would be freed object is sent a message, you can track it under the stack trace.

EDIT: I think this may explain better. http://www.codza.com/how-to-debug-exc_bad_access-on-iphone

0

精彩评论

暂无评论...
验证码 换一张
取 消