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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:35:16+00:00 2026-06-05T03:35:16+00:00

Im loading my array in a NSDocumentDirectory : self.images = [NSMutableArray new]; for(int i

  • 0

Im loading my array in a NSDocumentDirectory:

self.images = [NSMutableArray new];  
for(int i = 0; i <= 100; i++) 
{ 
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];

    NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"oneSlotImages%d.png", i]]; 
    NSLog(@"savedImagePath=%@",savedImagePath);
    if([[NSFileManager defaultManager] fileExistsAtPath:savedImagePath]){ 
        [images addObject:[UIImage imageWithContentsOfFile:savedImagePath]]; 

        NSLog(@"file exists");
    } 
    NSLog(@"file does not exist");
} 

NSLog(@"Count : %d", [images count]);  

Here is where I implement my array:

- (UIView *)carousel:(iCarousel *)_carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{

    view = [[UIImageView alloc] initWithImage:[images objectAtIndex:index]];
    return view;

}

I add the NSInteger with the array above in the viewDidLoad:

for (int x=0; x<+100;x++) {
        // add as NSString
        [images addObject:[NSString stringWithFormat:@"%d", x]];
        // add as NSNumber
        //[images addObject:[NSNumber numberWithInt:x]];
}

I’m having trouble adding NSInteger. How to add NSInteger to an NSMutableArray?

Im having a crash:

012-06-04 16:25:19.064 Yens_PhotoSlot[7543:1a303] -[__NSCFNumber
size]: unrecognized selector sent to instance 0x9a49b20 2012-06-04
16:25:19.067 Yens_PhotoSlot[7543:1a303] * Terminating app due to
uncaught exception ‘NSInvalidArgumentException’, reason:
‘-[__NSCFNumber size]: unrecognized selector sent to instance
0x9a49b20’
*
First throw call stack: (0x1ab6052 0x1e92d0a 0x1ab7ced 0x1a1cf00 0x1a1cce2 0x7dbc86 0x2bc4b 0xaadc 0xaefc 0xb6f7 0xf04f 0xa348 0xbddf
0x27cc7 0x7bafbf 0x7bb2d4 0x7bb5d7 0x7bb785 0x9d827c 0x797c92 0x7979a2
0x799a98 0x724499 0x724584 0x139ee00 0x199f4f0 0x19ed833 0x19ecdb4
0x19ecccb 0x32e1879 0x32e193e 0x6f3a9b 0x2efd 0x2e65 0x1) terminate
called throwing an exception

  • 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-06-05T03:35:18+00:00Added an answer on June 5, 2026 at 3:35 am

    Use NSNumber:

    [yourMutableArray addObject:[NSNumber numberWithInt:yourIntValue]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm loading an int* array of RGBA pixel data from a UIImage, doing manipulation
I'm getting a problem with loading a large array of images to a html
I'm doing some lazy loading of images into an array when the app has
I have trouble loading an array via a simple for loop into JFreeChart's DataSet.
I'm loading JSON data (array of objects) via service, onReady, and want to display
Loading new content in a HTML page when users reach the bottom is quite
Loading images into Flex (size < 100kb) causes IE7 memory increase by a megabyte
hey people im having trouble with loading my array of strings into a tableview
please can someone help me in saving and loading its Dynamic array from a
Instead of loading all annotations that are in my array, I would only like

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.