开发者

How do I generate code (or find the code generated) for fetch requests I created graphically using the data model editor in Xcode 4.x?

I can see where the code goes for the Entities, as NSManagedObject speciali开发者_StackOverflow中文版zed classes, that was very straightforward.

Bu t I do not see generated code or an option to generate code for visually designed fetch requests.


There is no actual "code" but just serialized NSFetchRequest objects in the data model file. You can get the NSFetchRequest objects themselves which you can query for their predicates and the like.

For fetch templates use -[NSMangedObjectModel fetchRequestTemplateForName:] and related methods.

If it's a fetch property you want, you get the entity description from the managed object model and then ask the entity for its fetched properties. Then use -[ NSFetchedPropertyDescrition fetchRequest] to get the actual NSFetchRequest object.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜