2010-08-17 56 views

回答

0

只需设置一个标志,当你的UITextView确实开始编辑(wasEdited = YES)并保存文本的当前状态(originalText = myTextView.text)然后后退按钮检查(originalText isEqualToString:myTextView.text & & wasEdited)

将被编辑的标签是为了避免串comparaison的情况下,用户没有进入编辑:)

0

iphony,比从未

犹未晚...

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { 
NSLog(@"textViewShouldBeginEditing"); 
return YES; 
} 
- (void)textViewDidBeginEditing:(UITextView *)textView { 
NSLog(@"textViewDidBeginEditing"); 
} 
- (void)textViewDidChange:(UITextView *)textView { 
NSLog(@"textViewDidChange"); 
} 
- (void)textViewDidChangeSelection:(UITextView *)textView { 
NSLog(@"textViewDidChangeSelection"); 
} 
- (BOOL)textViewShouldEndEditing:(UITextView *)textView { 
NSLog(@"textViewShouldEndEditing"); 
return YES; 
} 
- (void)textViewDidEndEditing:(UITextView *)textView { 
NSLog(@"textViewDidEndEditing"); 
}