Thursday, 8 August 2013

Beginning Objective-C:

Beginning Objective-C:

im programming an app and i dont know how I can change the menu
automaticly.In my view I have 6 buttons.When you start the App for the
first time the Buttons 1 2 3 appear.Now I want that if button 1 is pressed
once that the buttons 4 5 6 appear every time the app starts exect the
game is resseted ,then it starts again with button 1 2 and 3.I had the
idea of an integer 0 and when button 1 is pressed the integer gets
augmented by one and every start the programm checks if the int = 0 or 1
.But I have problems with writing the code it always gives me a fail
message.
.h
int newGameOrNot;
.m
newGameOrNot = 0;
-(IBAction)startButton:(id)sender{
if (newGameOrNot == 0) {
i++;
}
}
Sorry for my english i am learning it since a year,same with the code

No comments:

Post a Comment