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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:15:44+00:00 2026-05-23T19:15:44+00:00

i managed to read my question from my question.plist for question and answer. self.view.backgroundColor

  • 0

i managed to read my question from my question.plist for question and answer.

self.view.backgroundColor = [UIColor colorWithRed:99.0/255.0 green:162.0/255.0 blue:223.0/255.0 alpha:1.0];
self.title = @"Game"; //Set title.  

// Path to the plist (in the application bundle)
NSString *path = [[NSBundle mainBundle] pathForResource:
                  @"Question" ofType:@"plist"];

NSArray *array = [NSArray arrayWithContentsOfFile:path];

NSDictionary *dict = [array objectAtIndex:0];
questionlabel.text = [dict valueForKey:@"Question"];

a button here to call for QR code scanner, after scanning it will check if the answer is correct or wrong and direct the user to another question in the question.plist(objectAtIndex:1) if is correct if not it will pop up and show is incorrect

i can do it in a static way of creating a few more to xib to create other question statically, however i know this is a troublesome way to do it. anybody know how can i do it in a dynamic way?

thanks in advances

Desmond

  • 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-23T19:15:45+00:00Added an answer on May 23, 2026 at 7:15 pm

    What does the QR code scanner have to do with anything? I think it is not strictly relevant to your question, so I’ll only cover exactly what you’re asking. QR code scanning is not a part of the iOS and is provided by external libraries.

    Add an integer i-var to the view controller:

    @interface WhateverYouNamedYourViewController : UIViewController {
        // ....
        int currentQuestion;
        // ....
    }
    // ....
    @end
    

    Then, when loading the question and updating the UI, use that i-var to construct the NSString from which you’ll load the question.

    NSString *questionFileName = [NSString stringWithFormat:
                                  @"Question%d", currentQuestion];
    
    NSString *path = [[NSBundle mainBundle] pathForResource:questionFileName 
                                                     ofType:@"plist"];
    

    Alternatively, consider storing all questions in a single plist whose root is an array. Then use NSArray‘s -objectAtIndex: method to grab the current question (simply pass currentQuestion as the first argument).

    In any case, the place where you check for answer correctness (in a quiz) or where you record the answer (in a questionnaire) will need to update the current question and update UI:

    currentQuestion++;
    [self updateUI];
    

    Updating UI reads the next question and updates labels and buttons appropriately.

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

Sidebar

Related Questions

In continuation of this question I ask the following question. I've managed to read
i've read several thread for this question but unfortunatly not found the answer to
Can .NET (managed code) read and write to CouchDB? I would like to build
I've worked myself through the rapidXML sources and managed to read some values. Now
How to read query string value via managed bean in jsf1.1
I have successfully managed to get System.Speech.Synthesis to read English text in arbitrary voices
I've read a lot of articles and answers about paging in MVC. I've managed
How should I create application wide utility/manager classes that read settings from the database?
I (apparently) manage to make a ftp connection, but fail to read anything from
As part of a recent project I had to read and write from a

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.