I added a modal using AGWindowView
. Inside the modal view (built using IB), there is a textfield. The textfield has been connected to an outlet.
This doesn't work:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.placesTextField becomeFirstResponder];
}
The call to becomeFirstResponder
doesn't work and the keyboard doesn't show up.
This works:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.placesTextField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0];
}
However, if I manually send a message using performSelector:withObject:afterDelay
it works. Why is this method not being determined until runtime?
[self.placesTextField becomeFirstResponder];
– Toby