UITapGestureRecognizer de la biblioteca Objetos en el guión gráfico en una vista que está dentro de un controlador de barra de pestañas
Frecuentes
Visto 254 veces
1
I added a UITapGestureRecognizer to a view which is inside a tab bar controller and when I switch to the tab which contains the view with the UITapGestureRecognizer, I get a crash with the message -
-[__NSCFString setView:]: unrecognized selector sent to instance 0x2ae8d0
Estoy usando Xcode 4.3
1 Respuestas
2
i had this same trouble on iOS5 only with an app targeted to iOS 5 and iOS 6 and a gesture recognizer on the last tab. our code also has very similar gesture-recognizers that are loaded for modal dialogs or pushed view controllers for other tabs. so it was only gesture-recognizers in a tab that was not the first tab, and only in the rootViewController for that tab.
as Arunabh Das ended up doing, it would seem the only answer is really to add the UIGestureRecognizers in code. there is a thread at Ray Wenderlich's website (which is a decent site containing some good iOS tips) , which, summarized, notes that there appears to be a bug in iOS5, starting with the beta versions, never fixed in the final, and containing a code-snippet that shows how to put the gesture-recognizers in code if you want them.
Respondido el 30 de enero de 13 a las 09:01
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas ios xcode4 or haz tu propia pregunta.
It looks like you connected something up to the wrong object. Did you add the gesture recognizer in IB or in code? - rdelmar
In IB by dragging on to the storyboard. Should've done it in code. - Arunabh Das
Nevermind. I just added it in code and it works fine. Thanks for help. - Arunabh Das