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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:36:36+00:00 2026-06-04T21:36:36+00:00

I was hoping you could help answer an Objective-C based question for me that

  • 0

I was hoping you could help answer an Objective-C based question for me that is currently stopping me continuing in my program.

I have a game where you have a grid of buttons title 1, 2, 3, etc. Each of those buttons takes you to a GameScreen UIView passing with it various pieces of information – i.e. name, age, etc. If the user answers the question correctly, he is taken back to the grid – where I now want the button that he pressed to display a tick rather than just a blank button with some text as before.

My problem is keeping track of the button that was pressed. When I go back to the main screen, I can’t figure out how to say ‘Change the button that I just pressed to a tick image’. All things so far have come out as (null).

When I press a button at first I use the ‘if([sender.currentTitle isEqualToString:@”1″]) to tags what information I want to pass through – which is fine but after that point when I have been through another view I lose which button has been pressed.

I could pass through a variable all the way through that’s unique to each button and come up with an if then else statement to test the value of the variable (i.e. if [questionansweredcorrectly isEqualToString :@”Question1″]) but as I may have a hundred or more buttons here that’s too troublesome.

I hope I have explained the situation well enough and that someone will be able to point out the method I need to use here.

Thanks in advance!

EDIT:

In response to how I load into other views I use the following style of coding:

GameScreen *screen = [[GameScreen alloc] initWithNibName:nil  bundle:nil]; 
screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 
[self presentModalViewController:screen animated:YES];

and this is how I go to a new view – doing the same from another screen to go back to the main screen with the buttons. I don’t use storyboards in this piece. Does this help clarify how I go through the views? I do not use storyboards.

  • 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-06-04T21:36:38+00:00Added an answer on June 4, 2026 at 9:36 pm

    From what I understood you dismiss your first view completely. Or you reload the first view where as you should just show it again.

    Not 100% on how your loading your views but I think this might help:

    To show the previous view (with all the buttons) simply use this code in the view that you loaded on top of the first view:

    [self dismissModalViewControllerAnimated:YES];
    

    Hope it helps!

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

Sidebar

Related Questions

I was hoping someone could answer my quick question as I am going nuts!
HI All I was hoping someone could help me improve a query I have
I was hoping someone could help me in resolving this issue. I have 3
I have a small issue I was hoping somebody could help me with. I
I was hoping someone could help me with this I have data like this
I was hoping someone could help me with a little issue I'm having trouble
Im using the .NET framework 1.1 and Im hoping someone could help me implement
I've come across 2 confusing problems in SML and was hoping someone could help
Was hoping I could get a bit of a hand on this login that
I understand the obvious answer to my question is: it depends. With that out

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.