Last active
August 29, 2015 14:14
-
-
Save sonsongithub/37a7c05ef9bb88038b43 to your computer and use it in GitHub Desktop.
NSPredicate - predicateWithFormat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is OK | |
NSString *temp = [NSString stringWithFormat:@"title BEGINSWITH %@", searchBar.text]; | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:temp]; | |
// Bad... | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"title BEGINSWITH %@", searchBar.text]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment