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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:51:54+00:00 2026-06-07T06:51:54+00:00

In my Array 1 , which I loaded images from NSDocumentDirectory , I loaded

  • 0

In my Array 1, which I loaded images from NSDocumentDirectory, I loaded them and add a NSMutableDictionary:

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

    NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"Images%d.png", i]]; 
    if([[NSFileManager defaultManager] fileExistsAtPath:savedImagePath]){ 
        NSMutableDictionary *container = [[NSMutableDictionary alloc] init];
        [container setObject:[UIImage imageWithContentsOfFile:savedImagePath] forKey:@"image"];
        [container setObject:[NSNumber numberWithInt:i] forKey:@"index"];
        [images addObject:container];
    } 
}   

In my other array Array 2, I loaded them from the app.

    self.images = [NSMutableArray arrayWithObjects:
                   @"01.jpg",@"02.jpg",@"03.jpg",@"04.jpg",@"05.jpg",@"06.jpg",@"07.jpg",nil];

I was able to add string to Array 2 like this:

for (int x=1; x<8;x++) {
    // add as NSString
    [images addObject:[NSString stringWithFormat:@"%d", x]];

    }

And was able to compare Array 2 like this:

   NSInteger index = carousel.currentItemIndex;
    if ([[images objectAtIndex:index] intValue] == 1){

What I wanted to do, is to do it to Array 1.
I know Array 1 has been already added with NSNumber, but Im kinda new to NSMutableDictionary so I can’t do it the same as Array 2.

Can it be done the same as my Array 2 or what is the other way?

Thanks for the help.

  • 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-07T06:51:56+00:00Added an answer on June 7, 2026 at 6:51 am

    Actually Here you have the array of dictionaries, because you are adding the dictionary which has two objects with keys image and index

    So, for retrieving the array of dictionaries,

    just log it and see what happens

    Edit 2.0

    for(int i=0; i< [images count]; i++){
        NSNumber *num =[[images objectAtIndex:i] objectForKey:@"index"];
    
        int index = [num intValue];
    
        NSLog(@"%d",index)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array which looks like this: $arr = ( [0]=>Int(2) [1]=>Array( ....)
I have a WPF BitmapImage which I loaded from a .JPG file, as follows:
I have an tableview which is loaded from a mutablearray as listed below. However
I've some images on a page which are loaded randomly and they are over
I'd like to create an image dynamically which is combined from some other images.
I'm attempting to create a gallery/gridview that is loaded with images from a specific
I have an array which looks like this: $data = array( array('timestamp' => 1312776000,
I have a byte array which needs to be marshalled into the following struct:
I have an array which I want to use in a query: Array (
I have an numpy array which I save to a image using savefig(). Then

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.