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

  • Home
  • SEARCH
  • 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 3611568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:53:30+00:00 2026-05-18T21:53:30+00:00

I have a problem with my app, which run well on the simulator but

  • 0

I have a problem with my app, which run well on the simulator but when I launch on my iDevice I got an error:

     Terminating app due to uncaught exception 'NSInvalidArgumentException',
         reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'


    0   CoreFoundation                      0x3513cfd3 __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x303928a5 objc_exception_throw + 24
    2   CoreFoundation                      0x350bff99 -[__NSArrayM insertObject:atIndex:] + 472
    3   CoreFoundation                      0x350bfda7 -[__NSArrayM addObject:] + 34
    ....
    Program received signal:  “SIGABRT”.

In the debugger I can see where is the problem. The error comes from there, at the addObject:

for (int i = 0; i < [arrayValues count]; i++) {
    f = [[NSNumberFormatter alloc] init];
    [f setNumberStyle:NSNumberFormatterDecimalStyle];
    myNumber =[f numberFromString:[arrayValues objectAtIndex:i]];

    [arrayValues2 addObject:myNumber]; 
    [f release];    }

Here I convert objects of arrayValues (NSString) in NSNumbers in arrayValues2.

In the Simulator there is no problem, the arrays are not empties.
I don’t know where to look for.

I also checked the other posts of stackoverflow, they are not really like my error

  • 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-18T21:53:31+00:00Added an answer on May 18, 2026 at 9:53 pm

    well… I’m not sure what your problem is, but there is a much better way to do this…

    for(NSString *theString in arrayValues){
        NSNumber *aNumber = [NSNumber numberWithFloat:[theString floatValue]];
        [arrayValues2 addObject:aNumber];
    }
    

    which may help because you won’t be outstepping any array boundaries, or inserting any nil objects.

    If you want some more help you’re going to have to NSLog arrayValues and give us the output so we can see what you’re dealing with. 🙂

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

Sidebar

Related Questions

I have created Cocoa app which is type of launch agent. To distribute this
i have little problem with boost::asio library. My app receive and process data asynchronously,
I am building my first ASP.Net MVC based app and have a problem accessing
Problem: We have a web app that calls some web services asynchronously (from the
Problem 1: I have a simple winforms app and I want to DataBind my
I have a GUI app which connects to a sensor, gathers data and processes
Im trying to develop my first ASP.NET MVC web app and have run into
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am

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.