开发者

NSPredicate compare syntax objective c

开发者 https://www.devze.com 2023-03-31 19:49 出处:网络
I have the following expression NSPredicate* predicate = [NSPredicate predicateWithFormat:@\"v开发者_C百科alue1== %@\", variable1];

I have the following expression

NSPredicate* predicate = [NSPredicate predicateWithFormat:@"v开发者_C百科alue1== %@", variable1];

I want to expand the above expression to compare two values e.g."if((value1==variable1)&&(value2==variable2))

How is this possible?


NSPredicate* predicate = [NSPredicate predicateWithFormat:@"value1== %@ && value2 == %@", variable1, varible2];

Check out the predicate programming guide.

0

精彩评论

暂无评论...
验证码 换一张
取 消