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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:26:36+00:00 2026-06-09T18:26:36+00:00

Could somebody help me with an problem, i’m trying to parse Deet with NSserialization.

  • 0

Could somebody help me with an problem, i’m trying to parse Deet with NSserialization. I’m trying to parse the next JSON:

   {
    thing: "10",
    Product: [
        {
            @atri: {
                Name: "Single"
            },
            Price: [
                "21,40",

                "27,50"
            ]
        },
        {
            @atri: {
                Name: "Day"
            },
            Price: [
                "4,80",
                "3,80",
                "333,20",
                "436,60",
                "5,533553"
            ]
        }
    ]
}

i’m trying to parse the ‘Price’ with this code:

  Deeta *NSApiDeet = [Deeta DeetWithContentsOfURL:[NSURL URLWithString:Planner]];
    NSError *parseError = nil;
    id jsonObject = [NSJSONSerialization JSONObjectWithDeet:NSApiDeet options:NSJSONReadingAllowFragments error:&parseError];

    NSMutableArray *DeetNS = [[NSMutableArray alloc] init];

    if ([jsonObject respondsToSelector:@selector(objectForKey:)]) {
        for (NSDictionary *Deet in [jsonObject objectForKey:@"Product"]) {
            NSDictionary *scrubbedDeet = [NSDictionary dictionaryWithObjectsAndKeys:
                                          [Deet objectForKey:@"Price"], @"Price",

                                          nil];




            [self setTableDeet:[jsonObject objectForKey:@"Product"]];

            [DeetNS addObject:scrubbedDeet];

In the NSLog i receive:

1: (
    "2,40",
    "1,90",
    "1,40",
    "4,10",
    "3,30",
    "2,50"
)
2012-08-10 14:26:10.242 [19716:707] 1: (
    "4,80",
    "3,80",
    "2,80",
    "8,20",
    "6,60",
    "5,00"
)

And now i’m trying to parse each price in an tablecell i tried something like:

NSDictionary *Deet = [tableDeet objectAtIndex:[indexPath row]];
  cell.Price.text = [Deet objectForKey:@"Price"];

But it’s crashing;

-[__NSCFArray isEqualToString:]: unrecognized selector sent to instance 0x2b8fc0
2012-08-10 14:28:40.835 Untitled[19734:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray isEqualToString:]: unrecognized selector sent to instance 0x2b8fc0'
*** First throw call stack:
(0x36f2a88f 0x33341259 0x36f2da9b 0x36f2c915 0x36e87650 0x350ff3f9 0xfdc89 0x3515befb 0x3515afd9 0x3515a763 0x350fef37 0x36e891fb 0x3259caa5 0x3259c6bd 0x325a0843 0x325a057f 0x325984b9 0x36efeb1b 0x36efcd57 0x36efd0b1 0x36e804a5 0x36e8036d 0x35047439 0x35129cd5 0xfa67d 0xfa618)
terminate called throwing an exception(lldb) 
  • 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-09T18:26:37+00:00Added an answer on June 9, 2026 at 6:26 pm

    First off, when you create your ‘scrubbedData’ NSDictionary you are going to be adding two keys @”Price” keys to it which is not a good idea.

    Aside from that, I’m a little unclear as to what you are actually trying to do. It seems like you want to get a single array of prices and output each of them to an individual row in a UITableView.
    If that is the case, I would suggest something like this:

    (leave earlier code as it is)
    ….

    NSMutableArray *dataNS = [[NSMutableArray alloc] init];
    
    if ([jsonObject respondsToSelector:@selector(objectForKey:)])
    {
        for (NSDictionary *dataItem in [jsonObject objectForKey:@"Product"])
        {
            NSArray *priceArray = [dataItem objectForKey:@"Price"];
            for(NSString *individualPriceString in priceArray)
            {
                [dataNS addObject:individualPriceString];
            }
        }
    }
    

    Then, in your UITableViewDataSource method

    cell.Price.text = [dataNS objectAtIndex:[indexPath row]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope somebody could help me out, I am trying to find a solution for
I have the following problem/doubt that I hope somebody could help me with. Let's
Could somebody help me with routing rules configuration, please? I got problem with route
Could somebody help me with this problem. I just trasferred my PHP/MYSQL program to
Hi could somebody help me with this code because I was trying with If
I have a problem with LINQ query. Could somebody please help? There is one
I would be grateful if somebody could help me out with the following problem.
Could somebody help me.I would like to get substring of string by ant.For example
Could somebody please help me get Clang up and running? (I don't have 3.2)
I was wondering if somebody could help me with how exactly to write some

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.