在iOS7中调用textViewShouldBeginEditing两次

时间:2013-12-03 07:42:30

标签: ios objective-c ios7 uitextfield xcode5

我正在使用具有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;
}

1 个答案:

答案 0 :(得分:0)

试试这可能会对你有所帮助

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{

    if (textView==urtxtviewname) {

     //   do yur coding

    }
    else (textView ==urtxtviewname)

    {
      // do your coding

    } 
    return YES;

}