UIViewController - cannot become the first responder

Does anyone know why the UIViewController will not become the first responder when running this code:

[self becomeFirstResponder];
NSLog(@"is first resp: %i",[self isFirstResponder]);

In the console, I always see the line: "first resp: 0"

I have a canBecomeFirstResponder method:

- (BOOL)canBecomeFirstResponder {
return YES;
}

I don’t even know where to look further ....

+5
source share
3 answers

Update

As I suspected, I was mistaken in using UIViewController/ firstResponder. This thread on the apple dev forums talks about how to make shaking work.

Original answer

becomeFirstResponder UI, . UIViewController, (, , ).

. , UIViewController "" . (a UIView ).

, UIViewController , - (- ).

+4

, UIViewController , - .

+6

Do you have a UIScrollView in this UIViewController?

+4
source

All Articles