简体   繁体   English

EXC_BAD_ACCESS内存管理问题

[英]EXC_BAD_ACCESS memory management issue

I'm working on an iPhone/iPad application and I've got an unpleasant issue. 我正在使用iPhone / iPad应用程序,但遇到了一个不愉快的问题。

There is the class named MyWebViewController with a 有一个名为MyWebViewController的类,带有一个

@property (nonatomic, retain) NSString* currentPage;

and few methods: 和几种方法:

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    ...
    [self method1:self.currentPage];
    ...
}    

- (void)method1:(NSString *)key
{
    ...
    [self method2];
    ...
}

During dubugging when it comes to [self method2]; 在调试期间涉及[self method2]; row the app crashes with EXC_BAD_ACCESS exception but points to [self method1:self.currentPage]; 该行以EXC_BAD_ACCESS异常崩溃,但指向[self method1:self.currentPage]; row! 行!

I tried to enable NSZombie but it didn't help. 我尝试启用NSZombie但没有帮助。

So I'm completely confused and can't get what to do. 因此,我完全感到困惑,无法采取行动。 That's why I'd really appreciate your help! 这就是为什么我非常感谢您的帮助!

Unless you have a typo in your question, your method1 signature does not take a parameter, 除非您的问题中有错字,否则method1签名不带参数,

- (void)method1
{

but in your code, you call the method with the parameter. 但是在代码中,您可以使用参数调用方法。

[self method1:self.currentPage];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM