【发布时间】:2014-03-03 11:21:38
【问题描述】:
我在 NSManagedObject 上使用一个名为 NSManagedObject+Serialization.h 的类别,位于 https://gist.github.com/nuthatch/5607405。
一切都很好,但我需要实现它但不知道如何实现?我想跳过一些对象。
- (NSDictionary*) toDictionary {
// Check to see there are any objects that should be skipped in the traversal.
// This method can be optionally implemented by NSManagedObject subclasses.
NSMutableSet *traversedObjects = nil;
if ([self respondsToSelector:@selector(serializationObjectsToSkip)]) {
traversedObjects = [self performSelector:@selector(serializationObjectsToSkip)];
}
return [self toDictionaryWithTraversalHistory:traversedObjects];
}
如何添加要跳过的对象关系?
非常感谢
【问题讨论】: