I am making this kind of password to skip levels in a game. But I dont know what code I need to make a button change View Controller...
- (IBAction)button:(id)sender {
if ([txt.text isEqualToString:@"passwordToSkipLevel1"]) {
// Code to change View Controller???
}
}
I am not sure if I have done it correct to far, and I am not sure how I can make it change View Controller either...
Any ideas?
Extra: Is there any method to make the password not case sensetive?
What you have seems fine as far as it goes. To make the comparison case-insensitive, you can use
To change ViewController... is this a storyboard-based design? If so, you could write
where
SegueToLevel2CV
is the identifier you've given the segue that goes to the next level, typed in to Interface Builder when you constructed the storyboard.