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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:56:41+00:00 2026-05-30T09:56:41+00:00

I use apple’s code IconDownloader to download the image,I have added the IconDownloader file,but

  • 0

I use apple’s code IconDownloader to download the image,I have added the IconDownloader file,but it doesn’t work.

- (void)startIconDownload:(UserInfo *)userImageObject forIndexPath:(NSIndexPath *)indexPath
{
    IconDownLoader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath];
    if (iconDownloader == nil) 
    {
        iconDownloader = [[IconDownLoader alloc] init];
        iconDownloader.appRecord = userImageObject;
        iconDownloader.indexPathInTableView = indexPath;
        iconDownloader.delegate = self;
        [imageDownloadsInProgress setObject:iconDownloader forKey:indexPath];
        NSLog(@"indexPath:%@",indexPath);
        NSLog(@"iconDownloader:%@",iconDownloader);
        NSLog(@"imageDownloadsInProgress:%@",[imageDownloadsInProgress objectForKey:indexPath]);
        [iconDownloader startDownload];
        [iconDownloader release];
    }

}
// called by our ImageDownloader when an icon is ready to be displayed
- (void)appImageDidLoad:(NSIndexPath *)indexPath
{
    IconDownLoader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath];
    NSLog(@"%@",imageDownloadsInProgress);
    if (iconDownloader != nil)
    {
        UITableViewCell *cell = [myTableView cellForRowAtIndexPath:iconDownloader.indexPathInTableView];

        // Display the newly loaded image
        cell.imageView.image = iconDownloader.appRecord.image;

    }
}

this is my log:

1970-01-13 14:44:32.-714 Mo[5726:307] indexPath:<NSIndexPath 0x275260> 2 indexes [0, 0]
1970-01-13 14:44:32.-694 Mo[5726:307] iconDownloader:<IconDownLoaderTan: 0x2c57a0>
1970-01-13 14:44:32.-689 Mo[5726:307] imageDownloadsInProgress:(null)

we can see the problem is imageDownloadsInProgress dictionary is null,why?but the key(indexPath) and the object(iconDownloader) are not null.who can tell me why?thanks in advance.

I have defined the imageDownloadsInProgress in my .h file:

NSMutableDictionary *imageDownloadsInProgress;  
  • 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-30T09:56:43+00:00Added an answer on May 30, 2026 at 9:56 am

    two issues i think are in your code.

    1) imageDownloadsInProgress might not be initialized ..
    so initialize it in your vieDidLoad (can’t add objects without initializing)

    imageDownloadsInProgress = [NSMutableDictionary dictionary];
    

    2) You are setting index path as a key for the object in the dictionary…i believe you can only set NSString as a key so make a string with the index path using NSString stringWithFormat: and then store it in the dictionary

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

Sidebar

Related Questions

I tried to use this code but it doesn't work. http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html Ld /Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr Ngoo.app/Dr
I'm attempting to create a properly formatted video file for use in Apple's HTTP
I have read in the Apple Documentation that we can use optional parameters in
I'm trying to use Apple Core Data Sample code as a basis for my
I have seen the in-app purchrasing programming guide for apple. But it is mandatory
We've got a few pages that use the apple-mobile-web-app-capable meta tag (value=yes), but on
I have finally figured out how to use the apple Reachability files, which is
I use Apple Reachability class from Apple Sample code Reachability in Xcode 4.2 and
I have been wondering: What does Apple use to program Xcode? Surely they didn't
Can I use Apple's open source Core Foundation (CF classes) in a commercial product

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.