请先帮我一下如何将我的JSON存储到NSPredicate中。其他我能做的!
我的JSON:
RESULT :(
{
A01 = (
{
name = "Nano";
day = "monday";
},
{
name = "Nano";
day = "sunday";
},
);
A02 = (
{
name = "Nano";
day = "wednesday";
},
{
name = "Nano";
day = "tuesday";
},
);
}
);
答案 0 :(得分:0)
我认为你是新手,我将其作为步骤
写作答案 1 :(得分:0)
使用下面的代码将json存储在NSPredicate中,并根据需要进行一些过滤..
NSString *str = @"name";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.name CONTAINS[cd] %@",str];
json = [[json filteredArrayUsingPredicate:predicate] mutableCopy];
NSLog(@"%@",json);