开发者

Core data select objects from an array - iPhone

I was wondering if I could select objects based on a predicate with an array... for example

Code: [NSPredicate predicateWithFormat:@"id=%@开发者_Go百科", arrayOfID];

Will it work? If no, how can I do it?

Best


The correct predicate would be

[NSPredicate predicateWithFormat:@"id IN %@", arrayOfID];

Assuming that arrayOfId contains objects of the same type as id (e.g. NSNumbers or NSStrings).


Yes, of course you can do it.

Sounds like you need a bit of grounding in Core Data. I found the following tutorial really useful in getting me off the ground with Core Data:

http://iphoneinaction.manning.com/iphone_in_action/2009/08/core-data-part-1-an-introduction.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜