0
我需要过滤下列数组,状态等于“U”我已经使用了以下内容。使用谓词过滤器阵列
NSArray *result = [alertModified.senders filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(subscriptions.status = %@)",@"U"]];
但我得到空阵列。
请帮我过滤吗?
阵列字符串:
(senderCode = CPFB, senderName = CPFB, forSenderLevel = 0, subscriptions = (
"correspondenceListId = 102,status = S,senderCode = AA,subject = Letter,retentionPeriod = 0, uniqueBillIdentifier = (null),senderResponseStatus = (null),subscriptionDate = ,effectiveDate = ",
"correspondenceListId = 103,status = U,senderCode = BB,subject = Nomination Letters,retentionPeriod = 0, uniqueBillIdentifier = (null),senderResponseStatus = (null),subscriptionDate = ,effectiveDate = ",
"correspondenceListId = 104,status = U,senderCode = AA,subject = Yearly statements,retentionPeriod = 0, uniqueBillIdentifier = (null),senderResponseStatus = (null),subscriptionDate = ,effectiveDate = ",
"correspondenceListId = 105,status = U,senderCode = BB,subject = All Future Letters,retentionPeriod = 0, uniqueBillIdentifier = (null),senderResponseStatus = (null),subscriptionDate = ,effectiveDate = "))
所以,你需要排序**订阅**,或整个字符串? – 2012-04-16 11:34:32
这是一个由逗号分隔的字符串组成的数组吗? – wbyoung 2012-04-16 12:17:09
我不需要排序,但我需要筛选出状态为“U”的记录,即我应该从上面只取得3条记录。上面的字符串是对象层次的表示。 – lasi 2012-04-16 13:06:31