Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3951684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:45:36+00:00 2026-05-20T01:45:36+00:00

Greetz, I am currently having issues managing a Loading screen on my mainViewController (The

  • 0

Greetz,

I am currently having issues managing a “Loading” screen on my mainViewController (The first view the user accesses.) So basically the first view downloads an image and puts it on a UIImageView. While this happens the MBProgressHUD is displayed. Now then, the user goes to a secondView with its own controller. The user uploads an image and goes back. When the user goes back to the mainView, the mainView gets reloaded so the same image as before is NOT displayed. So logically, the “Loading” MBProgressHUD should display aswell. Nonetheless it crashes before it can even let it display, it crashes while making the transition.

The thing is the error exc_bad_access comes only if I have the MBProgressHUD implemented (must be a problem with memory management but I don’t seem to get it…) These are the segments with the 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 {
    // [...] get URL and 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 from screen when the HUD was hidded
   [HUD removeFromSuperview];
   [HUD release];
   // HUD = nil; I tried this because I found it on another 
   // answer in S.O. but it didn't quite work. 
   // I don't think it is the same case.
   // I also tried putting this on the dealloc method and 
   // the didReceiveMemoryWarning to no avail... 
}

This is the other question that treats a similar problem but that didn’t really solve mine.

Thank you very much for your future help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:45:36+00:00Added an answer on May 20, 2026 at 1:45 am

    You set HUD as the downloadProgressDelegate of request. Perhaps request tries to send a message to it after you release HUD. If you run your code in the debugger, the stack trace you get on the crash should tell you if this is the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetz, So this is rather a simple question (maybe not a simple answer). I
I am trying to understand how far I can go with PHP5's closures/callbacks, but
I'm trying to write an templated class with some methods/operators etc.. Now when the
hej Hej, My Question is related to my previous post: Get right ip adress
I am trying to develop an object oriented representation of a finite element model.
I'm at the moment trying to make a very simple app that will greet
I want to run a code that runs a function with a parameter (eg.
I have following problem: My program should decide at runtime to load an function
Why won't it shuffle the array so I get a random result each time?
I am dealing with a small tricky issue in matlab: I want to assign

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.