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 6071667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:04:25+00:00 2026-05-23T10:04:25+00:00

I display an UIImage in a view. Sometimes the requested image isn’t in the

  • 0

I display an UIImage in a view. Sometimes the requested image isn’t in the main bundle or in user folders.
If this is the case, I want to :

  1. start downloading the image from a remote server
  2. set a UIActivityIndicator on the target UIImageView
  3. after complete download, save the downloaded image in a folder
  4. load the UIImage in the UIImageView and stop the UIActivityIndicator

Dealing with the case where the user change the view while the download isn’t finished is hard. I do want the download to continue until the end. On the other end, he can go to another view lauching a parallel download.

I have created a DownloadManager with a static method +getImage:(NSString*)URL targetUIImageView:(UIImageView*)targetUIV
I want this method to instanciate new ImageDLClass with each it’s own ASIHTTPRequest, it’s own target (assign) UImageView. Testing if this target == nil permits to know if view is deallocated or not.

What I can’t figure out is, who will retain all the ImageDLClass instances, and how could I deallocate them after download finished.

I look for architecture ideas, I already know how to code each point. Do you have architecture ideas ?

Thanks for your help !

kheraud

  • 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-23T10:04:25+00:00Added an answer on May 23, 2026 at 10:04 am

    I finally use a better thing.

    The magick keyword here is “userInfo”. In fact you can link anything with a request and retreive this “anything” in the delegate methods.

    My architecture is the following :

    • A singleton ImageManager
    • ImageManager has one attribute : an array containing the request not finished yet
    • ImageManager has a method which launches an ASIHTTPRequest and add this request to its array
    • In the userInfo of each request there is a pointer to the target UIImageView
    • UIActivityIndicatorView is created (with 555 tag number) and added as subview to the target UIImageView after having started the asynchronous request
    • UIActivityIndicatorView is removed using its tag number

    The array attribute permits to cancel and release all non-finished requests if the ImageManager is deallocated.

    Hope it can help !

    kheraud

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

Sidebar

Related Questions

i want to display an UIImage within a UIImageView but it doesn't work and
I use ABUnknownPersonViewController to display a contact view. I try to set an image
i can display BG image in table view cell but when i click any
I want to load an image from an array and set the view to
I'm analyzing an image which takes some time and meanwhile I want to display
I'm trying to display a UIImage in real-time coming from the camera, and it
I want to add a logo view as iPhone application lunch. I code as
I currently have a application which will display the time allocated to a user
So this one is pretty odd ad I'm not sure if the trouble is
I have a UIButton on a UIView. I want to programatically figure out which

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.