I got the following error : unable to format the string @"( StudiesPatient.PatientName LIKE %@ AND ModalityName LIKE %@ AND StudiesPatient.PatientID LIKE @% )"
I use the below code , any suggestion how to fix it
]]; */
PatientName = (PatientName != @"")? PatientName : @"*" ;
Modality = (Modality != @"" )? Modality : @"*" ;
PataientID = (PataientID != @"") ? PataientID : @"*" ;
NSLog(PatientName ) ;
NSLog( Modality) ;
NSLog( PataientID) ;
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"( StudiesPatient.PatientName LIKE %@ AND ModalityName LIKE %@ AND StudiesPatient.PatientID LIKE @% )",
PatientName,
Modality,
PataientID ]];
Your last placeholder is mixed up –
@%instead of%@.