【发布时间】:2010-07-19 04:27:48
【问题描述】:
我想创建一个与 iPhone 的短信应用程序 (Messages) 完全一样的 ChatView。我正在以编程方式进行操作,并尝试使用键盘将 textView 向上移动。我想在 UIKeyboardWillShowNotification 调用的函数中执行此操作。你能帮我调试一下这个错误吗?
在 ChatViewController.m 中,我在 loadView 函数中为 UIKeyboardWillShowNotification 设置了一个侦听器,并将 self 设置为 textView 委托,但它崩溃了,说: 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“*** -[ChatViewController keyboardWillShow]:无法识别的选择器已发送到实例
但我在 ChatViewController.m 中定义了 keyboardWillShow 为什么找不到那个函数?
以下是重要文件:
http://github.com/acani/acani-chat/blob/master/Lovers/Classes/ChatViewController.h http://github.com/acani/acani-chat/blob/master/Lovers/Classes/ChatViewController.m
我注释掉了监听器,这样它就不会崩溃。
随意 git clone git@github.com:acani/acani-chat.git
谢谢!
【问题讨论】:
-
Github 不存在了?
标签: iphone chat uitextview uitextviewdelegate