ios - nspredicate substitution not working -


hi trying use substitutions error

nspredicate *pred = [nspredicate predicatewithformat:                      @"city $c $a or "                      " state $c $a or "                      " name $c $a "]; // <-- crashes here pred = [pred predicatewithsubstitutionvariables:@{@"a":self.searchbar.text,                                                   @"c":@"contains[c]"}]; 

this sample code apples documentation on subject

nspredicate *predicate = [nspredicate     predicatewithformat:@"date = $date"]; predicate = [predicate predicatewithsubstitutionvariables:     [nsdictionary dictionarywithobject:[nsnull null] forkey:@"date"]]; 

i not sure doing wrong. simple want $a place holders replaced same string; in case self.searchbar.text

can tell me why doesn't work?

apparently can use substitution on variables.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -