Core Data Fetched属性 - 基本(Core Data Fetched Properties - Basics)

IPhone IT屋
问 题

With Core Data Fetched Properties, how do I perform this simple request:

I want the Fetched Property (myFetchProp) to be on store StoreA, and it should do:

[myFetchProp getMeRecordWithPredicate:@“X == 35” inEntity:@“entityH” fromStore:StoreB];

Forgive my wrong-syntax, but I suppose my point is easy to understand.

I can’t find any simple and clear example on the net. I presume that should not be so difficult.


Since I have just read Marcus S. Zarra's Core Data: Data Storage and Management for iOS, OS X, and iCloud (2nd edition) (see here and here) let me quote it on the topic:

In practice, I have found fetched properties to be less useful and less flexible than either creating a stored fetch request or building the fetch request in code. Usually when a situation calls for a fetched property, it tends to be easier to subclass the entity in question, perform an NSFetchRequest in code, and return the results.

So the assumption that fetched properties can be simple may be wrong.

本文地址:IT屋 » Core Data Fetched Properties - Basics

问 题

通过Core Data Fetched属性,我如何执行这个简单的请求:

我想要Fetched属性( myFetchProp )存储到 StoreA ,它应该:

  [myFetchProp getMeRecordWithPredicate:@“X == 35”inEntity:@“entityH”fromStore:StoreB]; 




因为我刚刚读过Marcus S. Zarra的 核心数据:适用于iOS,OS X和iCloud的数据存储和管理 (第2版) (请参阅此处这里)让我引用它在主题:

问题,在代码中执行 NSFetchRequest 返回结果。


本文地址:IT屋 » Core Data Fetched属性 - 基本