也许这就是你要找的?
从AFIncrementalStore.h:
/**
Returns whether the client should fetch remote relationship values for a
particular managed object. This method is consulted when a managed object
faults on a particular relationship, and will call
`-requestWithMethod:pathForRelationship:forObjectWithID:withContext:` if `YES`.
@param relationship The relationship of the specifified managed object
@param objectID The object ID for the specified managed object.
@param context The managed object context for the managed object.
@return `YES` if an HTTP request should be made, otherwise `NO. */
- (BOOL)shouldFetchRemoteValuesForRelationship:(NSRelationshipDescription*)
relationship forObjectWithID:(NSManagedObjectID *)objectID
inManagedObjectContext:(NSManagedObjectContext *)context;
如果是这样,你可以用
- (BOOL)shouldFetchRemoteValuesForRelationship:(NSRelationshipDescription *)relationship forObjectWithID:(NSManagedObjectID *)objectID inManagedObjectContext:(NSManagedObjectContext *)context
{
return NO;
}
在
AFRESTClient <AFIncrementalStoreHTTPClient>
子
设置此。
来源
2013-03-05 16:01:00
yep
我也遇到过这个问题。我现在通过做一对多来解决它,知道那里只有一个对象。虽然这感觉很骇人听闻。我认为MAYBE'提取属性'将是答案,因为它们基本上是导致取回的属性,这在这种情况下似乎是有意义的。但是,我无法弄清楚如何访问我的requestForFetchRequest:withContext中的谓词信息。不仅如此,而且看起来像获取的属性是Arrays ANYWAY(一对多?)。猜猜我是CoreData新手。我啾啾@mattt这个链接虽然... – pj4533