[英]Compare multiple strings in textview of iphone
I want to compare all the strings entered in a textview of iphone. 我想比较在iphone的textview中输入的所有字符串。 Once the user finishes with typing in textview I want to compare strings entered by the user.
用户输入完textview后,我想比较用户输入的字符串。
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: 您必须将您的类设置为UITextViewDelegate并实现一些方法:
- (void)textViewDidChange:(UITextView *)textView
- (void)textViewDidEndEditing:(UITextView *)textView
I also don't know what you define by comparing all the NSString. 我也不知道您通过比较所有NSString定义了什么。 One way to do is put them into
NSSet
and NSSet
itself will remove duplicates of NSString
for you 一种方法是将它们放入
NSSet
, NSSet
本身将为您删除NSString
重复项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.