简体   繁体   中英

EXC_BAD_ACCESS memory management issue

I'm working on an iPhone/iPad application and I've got an unpleasant issue.

There is the class named MyWebViewController with a

@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]; row the app crashes with EXC_BAD_ACCESS exception but points to [self method1:self.currentPage]; row!

I tried to enable NSZombie but it didn't help.

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,

- (void)method1
{

but in your code, you call the method with the parameter.

[self method1:self.currentPage];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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