What 's wrong with predicate format below ?
if (devices && devices.count > 0 && ![tf_Search.text isEqualToString:@""]) {
NSString* strSearch = [NSString stringWithFormat:@"%@", tf_Search.text];
NSPredicate* preFilter =
[NSPredicate predicateWithFormat:@"(dRIV_NAMESURNAME CONTAINS[cd] %1$@) || (vEHI_PLATE CONTAINS[cd] %1$@)",
strSearch];
devicesFitered = [devices filteredArrayUsingPredicate:preFilter];
}
devicesFiltered array s not null and has 4 coredata device entity.
dRIV_NAMESURNAME and vEHI_PLATE are entity fields. NSString.
it gives > "'NSInvalidArgumentException', reason: 'Unable to parse the format string" error
if i use them seperatelly like in below 2 formats, no problem
@"(dRIV_NAMESURNAME CONTAINS[cd] %@)" > no problem
or
@"(vEHI_PLATE CONTAINS[cd] %@)" > no problem
is it about %1$@ ?
is it not possible in objc to address inputs like in cSharp "{1} asdas da {1} sdfs {2}"
What is the correct format ?