Ich habe Struktur wie:Kann mir jemand sagen, wie man NSPredate für NSArray mit NSDictionary in Objective C setzen?
[
{
"time": {
"td": 3036
},
"creditCardType": {
"cardType": "MasterCard",
"default": false
},
"transactionid": {
"transactionReferenceNo": "xyz",
"amount": 11.62,
"transactionStatus": "SUCCESS"
}
},
{
"time": {
"td": 3037
},
"creditCardType": {
"cardType": "MasterCard",
"default": false
},
"transactionid": {
"transactionReferenceNo": "xyp",
"amount": 13.62,
"transactionStatus": "SUCCESS"
}
}
]
in diese ich habe Duplikate transactionReferenceNo
in Bezug zu entfernen, denn die i Prädikat eingestellt ist als:
NSDictionary *transactionDict = [dict valueForKey:@"transactionid"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY %K.%K CONTAINS[c] %@", @"transactionid", @"transactionReferenceNo",[transactionDict valueForKey:@"transactionReferenceNo"]];`
dieser Wille stürzt meine Anwendung und gibt mir Fehler :
The left hand side for an ALL or ANY operator must be either an NSArray or an NSSet.
was falsch machen m ..
Vielen Dank im Voraus.
Dies funktioniert .. Danke Michael – PiyushRathi