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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:31:59+00:00 2026-06-04T17:31:59+00:00

I am very new to ios development, I am trying to add some values

  • 0

I am very new to ios development, I am trying to add some values from NSMutableDictionary to NSMutableArray, when I run the code I get this error

2012-05-29 14:09:34.913 iShop[7464:f803] -[__NSCFArray objectForKey:]:
unrecognized selector sent to instance 0x6e423d0 2012-05-29
14:09:34.915 iShop[7464:f803] * Terminating app due to uncaught
exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFArray
objectForKey:]: unrecognized selector sent to instance 0x6e423d0’
*
First throw call stack: (0x13cb022 0x155ccd6 0x13cccbd 0x1331ed0 0x1331cb2 0x2bb7 0x13cce42 0x93b9df 0x139f94f 0x1302b43 0x1302424
0x1301d84 0x1301c9b 0x12b47d8 0x12b488a 0x15626 0x28bd 0x2825)
terminate called throwing an exception(lldb)

below is my code:

-(void) getData:(NSData *) response {
    NSError *error;

    NSMutableDictionary *json = [NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:&error];
    //NSLog(@"%@", json);

    jsonArray = [[NSMutableArray alloc] init];

    jsonArray = [json objectForKey:@"Name"];

    NSLog(@"%@", jsonArray);

}

- (void)viewDidLoad {
    [super viewDidLoad];

    jsonURL = [NSURL URLWithString:@"http://localhost:8888/read_product_list.php"];
    dispatch_async(BgQueue, ^{
        NSData* data = [NSData dataWithContentsOfURL:jsonURL];
        [self performSelectorOnMainThread:@selector(getData:) 
                               withObject:data waitUntilDone:YES];
    });
}
  • 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-04T17:32:02+00:00Added an answer on June 4, 2026 at 5:32 pm

    JSONObjectWithData return an object of type id. depending on the structure of your received json data.
    The data recieved is eiher NSDictionary or NSArray. In your case I am guessing the top level object is of type NSArray which does not respond to objectForKey

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

Sidebar

Related Questions

I'm new to IOS development, and I'm just trying to get my head around
I am very new at iOS and objective-c development, so I am struggling with
I am VERY new with iOS development. So, please make your response as exact
I'm very new with iOS Development and I have just created one of my
First, I am super-new to Objective-C/iOS development and, in fact, this question is for
Hi I'm very new to ios development. I'm developing a map application where I
Ok, so I am very very new to iOS development and also to PHP
I am quite new to IOS development, so forgive me if this problem turns
xcode 4.2 ios 5 single view template I am very new to this ios
i am very new to ios development, rather i have just started work on

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.