I have a question,I don't know why Method 2 can't get value ?
Method 1:can get value!
-(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);
}
LOG:
filteredArray: (
{
JoinSuccess = 55566666666;
bmabout = "";
bmaddr = "\U53f0\U5317\U5e02\U9752\U5cf6\U6771\U8def99\U865f10F-6";
})
Method 2:can't get value!
-(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);
}
LOG:
filteredArray:(
)