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

  • Home
  • SEARCH
  • 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 7405007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:20:18+00:00 2026-05-29T05:20:18+00:00

I have a JSON structure like this: { id:100 contactInfo: { name: John Doe

  • 0

I have a JSON structure like this:

{
  id:100
  contactInfo: {
    name: John Doe
    city: New York
  }
}

and a corresponding Customer class w/ the following properties including a nested contactInfo class.

Customer.id
Customer.contactInfo.name
Customer.contactInfo.city

Is it possible to convert the JSON data directly to an instance of the Customer class?

I know how to get an NSDictionary object, but that is very cumbersome and verbose to work with and would rather convert/deserialize the data directly to the Customer class.

EDITED w/ Additional Info:

In other languages I have worked with there is built-in support for deserialization of JSON to custom objects. All you have to do is mark the class as “Serializable” and the JSON is deserialized w/o the need to write custom code in each class.

The NSDictionary object can become very cumbersome if the class has nested classes. It would be much easier to use the custom object properties like this

Customer.contactInfo.name

rather than

[(NSDictionary*)[customerDict objectForKey:@"contactInfo"] objectForKey:@"name"]

thus my question about a standard built-in deserializer in Objective-C.

  • 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-29T05:20:18+00:00Added an answer on May 29, 2026 at 5:20 am

    As of iOS5 there if official support for JSON
    https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html

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

Sidebar

Related Questions

I have a json structure that I'm decoding that looks like this: person =>
I have a directory structure like this: root folder1 abc.json def.json somedir more.json folder2
So I have a json object which has a structure like so: { John
I have some JSON returned to the browser like this product: { Title: School
I have this XML structure that I wish to construct in JSON format using
I have somewhat deep Json structure like below incoming over the wire into C#
I'm new to the GSON library, I have a json data structure that looks
I have a JSON tree structure that is generated dinamically, this means the keys
I have a JSON string (from PHP's json_encode() that looks like this: [{id: 1,
I am having trouble on formatting my json. Basically I have this script structure,

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.