iphone - Getting EXC_BAD_ACCESS when loading view (MBProgressHUD+ASIHTTPRequest) -


greetz,

i having issues managing "loading" screen on mainviewcontroller (the first view user accesses.) first view downloads image , puts on uiimageview. while happens mbprogresshud displayed. then, user goes secondview own controller. user uploads image , goes back. when user goes mainview, mainview gets reloaded same image before not displayed. logically, "loading" mbprogresshud should display aswell. nonetheless crashes before can let display, crashes while making transition.

the thing error exc_bad_access comes if have mbprogresshud implemented (must problem memory management don't seem it...) these segments code in question:

mainviewcontroller.m

- (void)viewdidload {       hud = [[mbprogresshud alloc] initwithview:self.view];    [self.view addsubview:hud];    hud.delegate = self;    hud.labeltext = @"please wait";    [hud showwhileexecuting:@selector(loadingofimageandinformation) ontarget:self        withobject:nil animated:yes];    [super viewdidload]; }  - (void) loadingofimageandinformation {     // [...] url , blabla.     asihttprequest *request = [asihttprequest requestwithurl:imageurl];     [request setdelegate:self];     [request setdidfinishselector:@selector(requestloaddone:)];     [request setdidfailselector:@selector(requestloadwentwrong:)];     [request setdownloadprogressdelegate:hud];     [request startasynchronous]; }  - (void)hudwashidden {    // remove hud screen when hud hidded    [hud removefromsuperview];    [hud release];    // hud = nil; tried because found on     // answer in s.o. didn't quite work.     // don't think same case.    // tried putting on dealloc method ,     // didreceivememorywarning no avail...  } 

this other question treats similar problem didn't solve mine.

thank future help!!

you set hud downloadprogressdelegate of request. perhaps request tries send message after release hud. if run code in debugger, stack trace on crash should tell if case.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -