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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:47:09+00:00 2026-05-25T00:47:09+00:00

I have searched throughout SO on this topic for iPhone and everything points to

  • 0

I have searched throughout SO on this topic for iPhone and everything points to the WWDC 2010 coverage, so yes I’m aware of that. But can anyone point me to a more detailed resource from where I can learn how to build a robust system for presenting different user interfaces on an app depending on the data that I’m presenting? I am fetching the data in a JSON format and my UI needs to vary depending on what I get out of the JSON parser.

Any books or online resources that give a detailed look into this topic?

Thanks!

  • 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-25T00:47:10+00:00Added an answer on May 25, 2026 at 12:47 am

    I recently had the same issue in one of my apps (navigation style) and the way I solved it is fairly simple.

    I had a user_type flag in my JSON response, and depending on that flag I would push a different view controller.

    For example, given my JSON response is stored in a NSMutableDictionary called “response”

    if ([response objectForKey:@"account_type"] == 1) {
      /*
        initialize user_type 1 viewController
      */
        [self.navigationController pushViewController:userType1ViewController animated:YES];
    else if ([response objectForKey:@"account_type"] == 2) {
      /*
        initialize user_type 2 viewController
      */
        [self.navigationController pushViewController:userType2ViewController animated:YES];
    }
    

    You can have as many different user_types as you want.

    Editing after clarification in comments

    You will likely be manually drawing these views.

    I would subclass UIView for each of the different question types you have listed (including properties for common elements like question title, choices, etc). Assuming that questions with the same question type will have the same layout.

    Then you can cycle through your JSON response (once it’s in an array or dictionary) and lay it out.

    If it’s a multiple choice question, make a new multipleChoiceQuestion view, add its properties, then addSubview to the main feed view. Then, for your next view, you will need to set the frame to be:

    nextQuestion.frame = CGRectMake(0, 0 + firstQuestion.frame.size.height, height, width);
    

    This will ensure that your second question is drawn right below the first question.

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

Sidebar

Related Questions

I have searched around, and it seems that this is a limitation in MS
I have searched the Web for this, but with no luck. Any idea? Thanks.
(have searched, but not been able to find a simple solution to this one
I have searched and found a couple of solutions on this site, that didn't
I have searched but cant find this question anywhere. My wife and I are
I have searched for this, but still can't seem to get this to work
I have searched the web for a way to do this, but perhaps I'm
I have searched and searched but as yet still cannot figure this ole problem
I have searched and searched for a solution to this problem, but it seems
I have searched around for an answer to this but can't find one. When

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.