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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:32:21+00:00 2026-05-22T12:32:21+00:00

Im going crazy trying to debug a problem, where I get an exception ***

  • 0

Im going crazy trying to debug a problem, where I get an exception

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString setText:]: unrecognized selector sent to instance 0x5799c90'

the code that is throwing it is:

- (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes
{

    for(int index=0;index<[pendingDownloadsArray count];index++)
    {
        if ([request isEqual:[[pendingDownloadsArray objectAtIndex:index]objectForKey:@"request"]])
        {
            NSNumber *x = [[pendingDownloadsArray objectAtIndex:index] objectForKey:@"completed"];

            float newCompleted = [x floatValue]+(float)bytes;
//          x+=(float)bytes;
                        NSLog(@"Completed: %fKb",newCompleted/1024);
            x = [NSNumber numberWithFloat:newCompleted];

            [[pendingDownloadsArray objectAtIndex:index] setObject:x forKey:@"completed"];
            float progress = newCompleted / (float)request.contentLength;

            //Dont try to get cell if the table is showing something else.
            if(self.selectedSegment ==0)
            {
                DownloadsCustomCell *cell =(DownloadsCustomCell*) [downloadsTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
                [cell.downloadProgressView setProgress:progress];
                NSString *progressLabelText = [NSString stringWithFormat:@"%.2f percent (%.2fKb / %.2fKb)",progress*100,
                                           newCompleted/1024,((float)request.contentLength/1024)];
                NSLog(@"%@",progressLabelText);
                UILabel *label = cell.downloadProgressLabel;
                label.text = progressLabelText;
            }

        }

    }
}

its throwing the exception on the last line. (i did not have the unnecessary ‘label’ at first… so its existence is a mark of how confused i am.
either problem is something I didnt know, or im doing something incredibly stupid that I am not able to spot.
Can you please help me assign that NSString to that UILabel?
(PS: i checked, downloadsProgressLabel IS A UILABEL.)

  • 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-22T12:32:22+00:00Added an answer on May 22, 2026 at 12:32 pm

    Option 1 – The problem is that the label was deallocated. cell.downloadProgressLabel points to bad memory, which happens to be a string sometimes, you should get different errors when executing that code.

    Option 2 – you’re creating downloadProgressLabel as a string instead of a uilabel, or you’re doing cell.downloadProgressLabel = [some string object]; somewhere in the code by mistake, although that should give a warning 🙂

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

Sidebar

Related Questions

I'm going crazy trying to write my first php class; it is supposed to
I'm going crazy trying to echo an <img> tag. I want to add this
It's late at night here and I'm going crazy trying to solve a linker
I've been going stir crazy trying to install the ruby mysql gem here, and
OS X 10.5.6. My Eclipse 3.4 is going crazy lately. After innocent operations like
I think I'm going a little crazy. Right now, I'm working with the following
This is driving me crazy. I'm not going to take it anymore. I'm going
I am going crazy with the onbeforeunload and form.submit(). You are my last hope
Ok, so maybe I'm just going crazy, but did Facebook remove the option to
I am going crazy. I am creating a website with the 960 grid system

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.