/ (achieve formerly) the truth about attribute of the Layout_weight in LinearLayout

filter array using NSPredicate for Names with beginning strings

I want to filter an array of Names (strings) which will be starting with a specific String in first name or last name. For example i have to obtain search results “Joel Mathew” & “Steve Joe” if i gave the string “Jo” to search. Thanks in advance.
Try this.

NSString nameFilter = @"Steve"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"(name like %@", nameFilter];

Then, filter the array

NSArray personArray = / obtain from somewhere */; NSArray *filtered = [personArray filteredArrayUsingPredicate:pred]; NSLog(@"%@",filtered);