Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>for a 3 level quiz, UINavigationController is definitely an option. </p> <p>if you need to find out how to use a class, in xcode, type its name, then press -alt- and double click the class name, this will bring up a short description, with two icons, one will take you to the header file, and the other to the documentation.</p> <p>to add elements to the nib/xib files, you will need to open the library window, where you will find labels, buttons etc. to use a button, you will need to define an action in your header file, and hook it up in IB, to be able to interact with UIElements in your code, you want to set up outlets in the header file, and hook them up in IB. </p> <p>something you need to decide on, is how you are going to present the questions, and will also depend if the answer will be true/false, multiple choice, or text entry.</p> <p>if you arent familiar with obj-c and xcode, it is probably worth picking up an ebook from someone like <a href="http://www.pragprog.com" rel="nofollow">http://www.pragprog.com</a>. they have an iPhone one up there by Bill Dudney which is quite good(i believe he now works for apple.)</p> <hr> <p>for the standard slide out transition you could use this. //you would probably want to call this something like level1NavBarItemWasPushed: instead - (IBAction)lvl1pushNavBarItem:(id)sender { //create instance of AnswersViewController class. AnswersViewController *level1AnswersVC= [[Level1AnswersViewController alloc] init];</p> <pre><code> //pass it some kind of identifier so it can tell which quiz/question it is dealing with and pull in the answers, so that you can reuse the view [level1AnswersVC setAnswersObject:&lt;&lt;insert object dictionary here&gt;&gt;]; //push the view controller onto the navigationController's view stack [self.navigationController pushViewController:level1AnswersVC animated:TRUE]; //pushing it onto the view stack has given it +1 retain, so we can now release it without worrying about it disappearing prematurely. [level1AnswersVC release]; } </code></pre> <hr> <p>for the page flip transition you could use this.</p> <pre><code>- (IBAction)lvl1pushNavBarItem:(id)sender { //create instance of AnswersViewController class. AnswersViewController *level1AnswersVC= [[Level1AnswersViewController alloc] init]; //pass it some kind of identifier so it can tell which quiz/question it is dealing with and pull in the answers, so that you can reuse the view [level1AnswersVC setAnswersObject:&lt;&lt;insert object dictionary here&gt;&gt;]; //set the current viewController as the delegate, so that it can call back to us when its done level1AnswersVC.delegate = self; //set the modal transition style level1AnswersVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; //show answers as modal view, which has been setup to use the page flip transition. [self presentModalViewController:level1AnswersVC animated:YES]; //pushing it onto the view stack has given it +1 retain, so we can now release it without worrying about it disappearing prematurely. [level1AnswersVC release]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload