I have an array within objects like below;
NSMutableArray* tableStructure = [[NSMutableArray alloc] init];
TableStructure *structure = [[TableStructure alloc] init];
structure.TableName =@"Client";
structure.Type =@"U";
structure.ColumnName =@"Id";
structure.DataType =@"int";
structure.Length = 2;
TableStructure *structure2 = [[TableStructure alloc] init];
structure2.TableName =@"Client";
structure2.Type =@"U";
structure2.ColumnName =@"Name";
structure2.DataType =@"text";
structure2.Length = 20;
[tableStructure addObject:structure];
[tableStructure addObject:structure2];
NSString *typeFilter = @"U";
NSString *nameFilter = @"sysname";
NSString *tableNameFilter = @"Sync";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"Type == %@ and DataType != %@ and TableName != %@)", typeFilter, nameFilter, tableNameFilter];
NSArray *filteredArray = [tableStructure filteredArrayUsingPredicate:pred];
When the debugger came to NSPredicete *pred... line, it gives 'Unable to parse the format string "Type == %@ and DataType != %@ and TableName != %@)"'
error.
How can I solve this?