我有一个问题,我不知道为什么方法2无法获得价值?
方法一:可以获得价值!
-(void) searchBar:(UISearchBar *) searchBar textDidChange:(NSString *)searchText{
NSString *firstName = @"55566666666";
AllMainEventRows3 = [AllMainEventRows mutableCopy];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@",firstName];
NSArray *filteredArray = [AllMainEventRows3 filteredArrayUsingPredicate:predicate];
NSLog(@"filteredArray: %@", filteredArray);
}
日志:
filteredArray: (
{
JoinSuccess = 55566666666;
bmabout = "";
bmaddr = "\U53f0\U5317\U5e02\U9752\U5cf6\U6771\U8def99\U865f10F-6";
})
方法二:无法取值!
-(void) searchBar:(UISearchBar *) searchBar textDidChange:(NSString *)searchText{
AllMainEventRows3 = [AllMainEventRows mutableCopy];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@",searchText];
NSArray *filteredArray = [AllMainEventRows3 filteredArrayUsingPredicate:predicate];
NSLog(@"filteredArray: %@", filteredArray);
}
日志:
filteredArray:(
)