简体   繁体   中英

Compare multiple strings in textview of iphone

I want to compare all the strings entered in a textview of iphone. Once the user finishes with typing in textview I want to compare strings entered by the user.

How do I do it?

Please help

I am not sure what you define "finishes with typing", here is my guess:

You have to set up your class become UITextViewDelegate and implements some methods:

  • If you want to get the text whenever the text changes, use:

- (void)textViewDidChange:(UITextView *)textView

  • If you want to get the text whenever the text view resign first responder, use:

- (void)textViewDidEndEditing:(UITextView *)textView

I also don't know what you define by comparing all the NSString. One way to do is put them into NSSet and NSSet itself will remove duplicates of NSString for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM