ios - How to disable button after last answer typed in .txt file? -


I'm making word games in xcode! But I do not need to be able to play after the user completes the game ... It is true that after completing the game, I warn them with pop ups and then take them back to the main menu in ViewController .

But if the user taps the button at the end of the game, he should not be able to play the game at any time. How do I disable the play button at the end of the game?

Code for the Play button:

  - (IBAction) btPlayClick: (ID) sender {AudiServicesWebsystemSound (Sound 2); PlayViewController * viewcontroller = [[PlayViewController alloc] initWithNibName: @ "PlayViewController" bundle: zero]; See Controller. Model Transition Style = UMODAL Transition StyleFlipHoriginal; [Self-present ViewController: Animated View Controller: Yes Completed: Zero];   

}

And I have an int for the current level called "ncurrentLevel"

There are 100 levels and 100 words in the TSTT file.

How is this done?

All UIControl classes (including UIButton ) Has a property), enabled , which determines whether they respond to touch events. You can change your button enabled property to NO < / code>. You will most likely be able to create and wire the IBOutlet for your button so that you can easily manipulate it.

Of course if the user starts a new game, you will need it to enable your button again :)

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -