- [UIViewController _keyboard]: selector no reconocido enviado a la instancia 0x7b731ac0
Estoy escribiendo una aplicación con 3 viewControllers contenidos dentro de un MainViewController. Uno de estos se controla a través del guión gráfico y muestra anuncios. Los otros dos viewControllers muestran información. Dependiendo del botón de menú presionado y el viewController que se presentará, la aplicación determina qué viewController debe cambiar.
Hasta ahora todo funciona bien, excepto cuandoALGUNA textField está seleccionado. Esto hace que se muestre el error. La instancia es el viewController que contiene el textField, y también es el UIViewController nombrado en el error. Además, la instancia no es nula. He colocado un punto de interrupción en:textFieldShouldBeginEditing:
y este método se llama antes de que ocurra el bloqueo. La aplicación es universal y no se bloquea en la versión para iPhone, que usa la misma configuración, excepto que solo tiene los anuncios y otra vista. Avíseme si necesita ver más código o tener alguna idea. No puedo encontrar el selector_keyboard
en cualquier lugar y no tengo idea de qué hacer desde aquí.
Intenté crear un nuevo proyecto con un código mínimo para mostrar el error, pero todos los proyectos nuevos funcionan bien, por lo que el problema no es tener demasiados viewControllers visibles a la vez. También sé que mi código de transición funciona bien porque funciona en los nuevos proyectos. Los viewControllers que he escrito tampoco son el problema, porque se usa exactamente el mismo viewController en la parte de iPhone de la aplicación, así como en un nuevo proyecto de prueba solo para iPad y el problema no aparece en absoluto.
[editar - código eliminado, probé el código en un nuevo proyecto y funcionó bien]
[edit2 - código agregado y explicación]
@implementation FSMainiPadViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.leftView = [[UIView alloc] init];
self.rightView = [[UIView alloc] init];
if (!self.testVC) {
self.testVC = [[FSTestViewController alloc] initWithNibName:nil bundle:nil];
}
self.inputViewController = self.testVC;
self.resultsVC = [[FSResultsTableViewController alloc] initWithNibName:nil bundle:nil];
self.dataViewController = self.resultsVC;
self.leftView.frame = CGRectMake(0, VIEWFRAMEOFFSET/2, self.view.frame.size.width/2 , self.view.frame.size.height - IPADBANNERHEIGHT - VIEWFRAMEOFFSET/2 - MENUHEIGHT);
self.rightView.frame = CGRectMake((self.view.frame.size.width)/2, VIEWFRAMEOFFSET/2, self.view.frame.size.width/2, self.view.frame.size.height - IPADBANNERHEIGHT - VIEWFRAMEOFFSET/2 - MENUHEIGHT);
[self addChildViewController:self.inputViewController];
[self addChildViewController:self.dataViewController];
[self.view addSubview:self.inputViewController.view];
[self.view addSubview:self.dataViewController.view];
[self.dataViewController didMoveToParentViewController:self];
[self.inputViewController didMoveToParentViewController:self];
}
Seleccionar el campo de texto causa este mismo error. Literalmente he comentado todo lo demás en mi MainViewController y todavía causa este problema, pero si creo un nuevo proyecto, incluso incluyendo mi código más complicado y xib, no puedo recrear el bloqueo.
Avísame si quieres más código.
Stacktrace*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FSSettingsViewController _keyboard]: unrecognized selector sent to instance 0x7da1dbf0'
*** First throw call stack:
(
0 CoreFoundation 0x0326d946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x02ef6a97 objc_exception_throw + 44
2 CoreFoundation 0x032755c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x031be3e7 ___forwarding___ + 1047
4 CoreFoundation 0x031bdfae _CF_forwarding_prep_0 + 14
5 UIKit 0x01e46d91 -[UIInputViewSet keyboard] + 52
6 UIKit 0x01b0807c -[UIKeyboardImpl setOrientation] + 94
7 UIKit 0x01b082c8 -[UIKeyboardImpl setFrame:] + 197
8 UIKit 0x01939084 UIViewCommonInitWithFrame + 1072
9 UIKit 0x01938bea -[UIView initWithFrame:] + 124
10 UIKit 0x01b02b62 -[UIKeyboardImpl initWithFrame:] + 107
11 UIKit 0x01b01c58 +[UIKeyboardImpl sharedInstance] + 158
12 UIKit 0x01e3bf4f -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 962
13 UIKit 0x01a845a5 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 316
14 UIKit 0x01a838ec -[UIResponder becomeFirstResponder] + 562
15 UIKit 0x0194a1c0 -[UIView(Hierarchy) becomeFirstResponder] + 114
16 UIKit 0x02115477 -[UITextField becomeFirstResponder] + 51
17 UIKit 0x01d183ef -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 200
18 UIKit 0x01d1aa16 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 2762
19 UIKit 0x01d0e287 _UIGestureRecognizerSendActions + 327
20 UIKit 0x01d0cb04 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 561
21 UIKit 0x01d0eb4d -[UIGestureRecognizer _delayedUpdateGesture] + 60
22 UIKit 0x01d124ca ___UIGestureRecognizerUpdate_block_invoke661 + 57
23 UIKit 0x01d1238d _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
24 UIKit 0x01d06296 _UIGestureRecognizerUpdate + 3720
25 UIKit 0x0191f26b -[UIWindow _sendGesturesForEvent:] + 1356
26 UIKit 0x019200cf -[UIWindow sendEvent:] + 769
27 UIKit 0x018e5549 -[UIApplication sendEvent:] + 242
28 UIKit 0x018f537e _UIApplicationHandleEventFromQueueEvent + 20690
29 UIKit 0x018c9b19 _UIApplicationHandleEventQueue + 2206
30 CoreFoundation 0x031911df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
31 CoreFoundation 0x03186ced __CFRunLoopDoSources0 + 253
32 CoreFoundation 0x03186248 __CFRunLoopRun + 952
33 CoreFoundation 0x03185bcb CFRunLoopRunSpecific + 443
34 CoreFoundation 0x031859fb CFRunLoopRunInMode + 123
35 GraphicsServices 0x0519f24f GSEventRunModal + 192
36 GraphicsServices 0x0519f08c GSEventRun + 104
37 UIKit 0x018cd8b6 UIApplicationMain + 1526
38 FoodStorage 0x000a795d main + 141
39 libdyld.dylib 0x04e14ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Esta es la primera vez que la máquina de Google me ha decepcionado. En todos los problemas que he tenido al hacer esta aplicación, este es el único problema que parece que no puedo encontrar a nadie más.