Hello everyone this may be silly question and may be asked before, I want to filter the array using predicate. I have an array which contains dictionary of same type like following.
<NSArrayM>(
ID:54d3ca82535c12243400c254
Room JID:(null)
name:(null)
photo:(null)
type:3
lastMessage:Gand
lastMessageDate:2015-02-05 20:02:47 +0000
occupantIDs:(
2285222,
2285224
)
userID:2285224
unreadMessagesCount:4
lastMessageUserID:2285224
)
I want to filter the array by the key occupantsIDs which is array. I want to create predicate which match occupantIDs as key. I want to know can i use that for filter the array.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"occupantIDs = @[2285222,2285224]"];
NSArray *filterArray = [dialogs filteredArrayUsingPredicate:predicate];
Any answer can be appreciated.