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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:54:24+00:00 2026-06-10T10:54:24+00:00

I am having issues getting the json format by a specific . I can

  • 0

I am having issues getting the json format by a specific “”. I can see that it is a dictionary so am I turning the dictionary into an array wrong? I am trying to pull the records that “isReserevble=true” and then display the “begin” with just the time in the table view cells based on the user selection from a UIDatepicker.
The json is coming through with NSlog but I am not able to figure this out. Thanks

It looks like I hae an array of dictionaries. Would I still use the same methods?

here is my code.

- (void)viewDidLoad
{
    [super viewDidLoad];
    dispatch_async(kBgQueue, ^{
        NSData* data = [NSData dataWithContentsOfURL: 
                        kLatestKivaLoansURL];
        [self performSelectorOnMainThread:@selector(fetchedData:) 
                               withObject:data waitUntilDone:YES];

    });

}
- (void)fetchedData:(NSData *)responseData {
//parse out the json data

NSError* error;

NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];

NSArray* myslots =[json objectForKey:@"slots"];
NSLog(@"allslots: %@", myslots);


  NSMutableArray *datesArray = [[NSMutableArray alloc] init];
for (NSDictionary *slots in json){
    NSLog(@"isReservable = %@",[myslots objectForKey:@"isReservable"]);
    if ([[myslots objectForKey:@"isReservable"]isEqualToString:@"1"]) 
    {
        NSLog(@"begin = %@",[myslots objectForKey:@"begin"]);
        [datesArray addObject:[myslots objectForKey:@"begin"]];
        NSLog(@"slots array count = %d",[datesArray count]);
    }

}
NSLog(@"This is the begin: %@", datesArray);

}

Here is my result of NSLog all slots:

2012-08-29 11:54:26.531 GBSB[1137:15b03] allslots: {
    "2012-08-29 00:00:00 America/Los_Angeles" =     (
                {
            begin = "2012-08-29 00:00:00 America/Los_Angeles";
            end = "2012-08-29 08:00:00 America/Los_Angeles";
            isPending = 0;
            isReservable = 0;
            isReserved = 0;
            label = " ";
            span = 1;
        },
                {
            begin = "2012-08-29 08:00:00 America/Los_Angeles";
            end = "2012-08-29 08:15:00 America/Los_Angeles";
            isPending = 0;
            isReservable = 1;
            isReserved = 0;
            label = " ";
            span = 1;
        }
    );
}

Ok: Here is now what I am getting

2012-08-30 09:28:30.812 GBSB[835:15b03] its a dictionary
2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
2012-08-30 09:28:30.813 GBSB[835:15b03] This is the begin: (
)
  • 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-10T10:54:25+00:00Added an answer on June 10, 2026 at 10:54 am

    The error message is – again – helpful. Try to interpret it:

    -[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x81e1c80
    

    That means, you sent the objectForKey: message to the JSON string object instead of the parsed NSDictionary object, that’s what’s wrong.

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

Sidebar

Related Questions

I know it can be done but am having issues getting it to work.
Having issues getting myself started on MVC3 Trying to define a simple route here
Having issues getting specific background images to display in Firefox/Opera, all other browsers are
Having issues getting links that match a given word to display using Xpath and
I am having issues getting this to work, here is what I am trying
I'm having issues getting this JSON object to load via JSONP in Chrome 18
Im having issues getting this to work, maybe its not even possible? I have
I'm having issues getting the CSS3 box-shadow to look correct. I currently have a
I am having issues getting setCenter to work. My JS console tells me: myMap
I am having issues getting the -e and -d file test operators to work

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.