2011-12-22 32 views
1

目前,我測試一個UITextView是否髒了或不:如何判斷UITextView是否髒?

if ([self.textView.undoManager canUndo]) ... 

這是總是正確的?或者UITextView中有類似isDirty的方法嗎?

回答

2

你可以聽很多東西與UITextViewDelegate

退房的UITextViewDelegate documentation綜合信息

- (void)textViewDidBeginEditing:(UITextView *)textView

- (void)textViewDidEndEditing:(UITextView *)textView

- (void)textViewDidChange:(UITextView *)textView

還有更多的事情要做shouldBeginshouldEnd編輯以及選擇更改。

希望有幫助。