I want that when the user puts a number in a textfield this number will be used for lots of operations, but this number can’t be 0, i created a error message that will be displayed if user clicks on the “next” button whit a 0 on the textfield, but this message don’t have time to appear, because this button takes the user to another view, how do i tell the button to stay in that view until the number is ok? my button implementation:
- (IBAction)calc:(id)sender {
int mynumber;
mynumber = [textfieldnumber.text intValue];
if (mynumber==0) {
NSString *errorstr = [[NSString alloc] initWithFormat:@"Please, set the number of people..."];
labelerror.text = errorstr;
}
}
Remove the Segue from Storyboards. Then make a new one that goes from file owner, or the little yellow box at the bottom of a selected view to the new modalViewController. Set it’s identifier and remember it. Then change this:
to this:
or