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
Post a Comment