谁能给我解释一下“fault”的意思?
这里是来自 Apple 核心数据性能文档的“故障行为”文档。
Faulting Behavior
Firing faults can be a comparatively expensive process (potentially requiring a round trip to the persistent store), and you may wish to avoid unnecessarily firing a fault. You can safely invoke the following methods on a fault without causing it to fire: isEqual:, hash, superclass, class, self, zone, isProxy,isKindOfClass:, isMemberOfClass:, conformsToProtocol:, respondsToSelector:, description, managedObjectContext, entity, objectID, isInserted, isUpdated, isDeleted, and isFault.
Since isEqual and hash do not cause a fault to fire, managed objects can typically be placed in collections without firing a fault. Note, however, that invoking key-value coding methods on the collection object might in turn result in an invocation of valueForKey: on a managed object, which would fire a fault. In addition, although the default implementation of description does not cause a fault to fire, if you implement a custom description method that accesses the object’s persistent properties, this will cause a fault to fire.
Note that just because a managed object is a fault, it does not necessarily mean that the data for the object are not in memory—see the definition for isFault.
谢谢!!
最佳答案
一般而言,错误
是对您引用某些数据但该数据实际上不在内存中的情况的描述(因此它不是立即可用的,需要从其他地方获取)。
因此,您有一个托管对象实例,但您只能对其调用几个方法,而不会导致收集额外数据并将其加载到内存中。
关于ios - 什么是 "Faulting"行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17429762/