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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:14:00+00:00 2026-05-31T20:14:00+00:00

When I NSLog my NSMutableArray, what I get is the following { ABSNFGH True,

  • 0

When I NSLog my NSMutableArray, what I get is the following

{  ABSNFGH True,
FDGJDKG False
GFKFLDL True
PDHJHN True
FHKDMD True
DSHDMD False )

The problem is that, I am not creating this array. But I want to store each entry(e.g. ABSNFGH) in a string and its corresponding status in a bool inside a for loop . How can I do this?

  • 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-31T20:14:02+00:00Added an answer on May 31, 2026 at 8:14 pm

    Suppose we name your array as yourArray

    yourArray ->  {  ABSNFGH True,
                      FDGJDKG False,
                      GFKFLDL True,
                      PDHJHN True,
                      FHKDMD True,
                      DSHDMD False }
    

    You need to add this loop:

    for(int i = 0; i<[yourArray count];i++)
    {
        NSArray *array = [[yourArray objectAtIndex:i] componentsSeperatedByString:@" "];
        if([array count]>1)
        { 
            NSString *stringValue = [array objectAtIndex:0];
            BOOL val = [[array objectAtIndex:1] boolValue];
        }
    }
    

    I think this should work. I have not tried implementing it personally, but may be this would work.

    EDIT:

    yourArray should ideally be like this:

    (  
      {
          stringVal = 'ABSNFGH' 
          boolVal = True
      },
      {
          stringVal = 'FDGJDKG' 
          boolVal = False
      },
      {
          stringVal = 'GFKFLDL' 
          boolVal = True
      }
    )
    

    Refer to this link. Here you just need to replace object with a NSDictionary and you are done.

    Making an array of Objects in Objective-C.

    Here I have modified ennuikiller’s answer from that link, to make you understand for your case:

    @interface Controller

    NSMutableArray *yourArray;
    
    @end
    @implementation Controller
    
    -(void) viewDidLoad {
    ................
    NSMutableArray *yourArray = [NSMutableArray initWithCapacity:40];
    
    }
    
    -(IBAction)doSomeWork
    {
          NSDictionary *object = [[NSDictionary alloc] init];
          [object setValue:@"ASDFG" forKey:@"stringVal"];
          [object setBool:False forKey:@"boolVal"];
    
          [yourArray addObject:object];
    
    }
    @end
    

    Hope this helps.

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

Sidebar

Related Questions

Not sure why I get Missing sentinel in function call? NSMutableArray *kkk = [NSMutableArray
I'm two days with the following problem and I can not solve, I got
I have the following method: -(void)testAPIModule { self.requests = [NSMutableArray array]; NSLog(@making arrays); /*(A)*/
I use NSLog in my application. And I'd like to get rid of the
When I send an object to NSLog, I get a string with three attributes.
I have the following code: NSLog(@items: %d, [items count]); NSLog(@allObjects: %d, [self.allObjects count]); [self.allObjects
I want to define a following function: if(stmtToFinalize) { NSLog(@Finalizing statement stmtToFinalize); if (sqlite3_finalize(stmtToFinalize)
I'm using a NSDictionary to get a NSString from a plist with the following
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:3]; if ([arr isMemberOfClass:[NSMutableArray class]]) { NSLog(@YEP!!); } else {
I have the following line of code: NSString *dMidiInfo = [object valueForKey:@midiInformation]; That returns

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.