我正在使用具有iOS 7.0的Xcode 5.0.2和iPhone 5,其中textViewShouldBeginEditing被调用两次。
是否有任何解决方案,以便一次调用textViewShouldBeginEditing方法?
这是我的代码:
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
[textView resignFirstResponder];
if (mIsEditing == NO)
{
[textView resignFirstResponder];
mIsEditing = YES;
[mDelegate updateViewForEditMode: YES : textView];
}
return NO;
}
答案 0 :(得分:0)
试试这可能会对你有所帮助
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
if (textView==urtxtviewname) {
// do yur coding
}
else (textView ==urtxtviewname)
{
// do your coding
}
return YES;
}