"Show Answer" button on initial screen displays last answer


When you first launch the app, if you click on the Show Answer button an answer appears even though there wasn’t a question asked.

Should there be another if-instance like the “Am I past the last question” if-instance? Or is there another way to prevent this?

BTW: the answer is for the first question in the array (which is really the last question to show in the sequence as explained in another post)


Yes, you could set up the application to not show an answer until a question has been asked. Simply having a BOOL ivar that dictates whether or not the answer should show that gets set to YES when showQuestion: is invoked.

The same reasoning for the other post you referenced is in play here: it doesn’t have much to do with iPhone programming.