我正在尝试根据其字符串字段之一过滤数组。
nameLower和filterLower都在内部具有NSString值,但是我不断得到:
__NSCFString containsString:]: unrecognized selector sent to instance 0x7f876b79e160
-(void) filterFriendsArray:(NSString*)filter {
[_filteredFriendsArray removeAllObjects];
for (FacebookUser* user in _friendsArray)
{
NSString* nameLower = [user.user.name lowercaseString];
NSString* filterLower = [filter lowercaseString];
if ([nameLower containsString:filterLower])
[_filteredFriendsArray addObject:user];
}
_displayedFriendsArray = _filteredFriendsArray;
}
containsString:
方法只加入在IOS 8.