N
N
nicepoint2014-09-09 19:35:20
Objective-C
nicepoint, 2014-09-09 19:35:20

Xcode Textfield: Validate text entered into Textfield?

Hello, I am not an application developer, but for everyday needs I use X-code to build applications for my students through the Main.Storyboard user interface. I do tests for them, which so far only required the output of a window: right or wrong. Now it was necessary to make sure that when typing text into the Textfield, the application checks against the predefined information: true or false and shows the button: Correct or Incorrect.
I would be grateful for any useful information on the merits, links to lessons, including paid ones. If you could explain in simple Russian and on your fingers how to do this, you would also be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
smanioso, 2014-09-10
@nicepoint

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Вся магия в этой строчке
    [myTextField addTarget:self action:@selector(checkTextfieldValue) forControlEvents:UIControlEventEditingChanged];
}

- (void)checkTextfieldValue
{
    // тут производим проверку и работаем с интерфейсом
}

@end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question