问题描述
|
大家好
在我的iPhone应用程序中,我需要在单击textfield时滚动页面,实际上,当我使用\“ UIKeyboardBoundsUserInfoKey \”时,它在ios设备3.1.3上与xcode 3正常运行
但是当我将我的xcode 3升级到4时,它发出警告说UIKeyboardBoundsUserInfoKey已过时,您不能使用它,所以我用UIKeyboardFrameBeginUserInfoKey替换了该API,现在警告消失了,但在ios设备3.1.3上不起作用,当我单击文本字段时它无法尝试滚动页面,但会导致崩溃,我该如何解决这个问题,有人可以帮助我吗……
解决方法
尝试这个:
if (&UIKeyboardFrameBeginUserInfoKey!=nil) {
// use UIKeyboardFrameBeginUserInfoKey
} else {
// use UIKeyboardBoundsUserInfoKey
}