如何使NSManagedObjectContext脏(hasChanges = YES)手动 [英] how to make NSManagedObjectContext dirty (hasChanges = YES) Manually
问题描述
问题是:
在 - (void)中设置transient undefined属性didSave
metod在第一个之后 save:
在iOS 4.3(模拟器)中不会使上下文脏,但是在iOS 5.0模拟器中使它变脏。
我需要在iOS 4.3中的相同行为。 p>
那么,在2 (BOOL)save:
调用之间做上下文的最便宜的方法是什么。
再次 - 在iOS 5中,在 - (void)didSave
中设置transient属性会使上下文脏,但在ios 4.3上不是。 / p>
和更多 - 我需要使所有在 didSave
方法脏中更改的对象
the problem is:
while setting transient undefined attribute in -(void)didSave
metod after first save:
does not make context dirty in iOS 4.3 (Simulator), but makes it dirty in iOS 5.0 Simulator.
I need the same behaviour in iOS 4.3.
So - what is the cheapest way to make context dirty between 2 (BOOL)save:
calls.
Once again - in iOS 5 setting transient attribute in -(void)didSave
makes context dirty, but on ios 4.3 not.
and more - I need to make all objects that were changed in didSave
method "dirty"
Have you tried subclassing NSManagedObjectContext and returning true for the hasChanges property or similar?
这篇关于如何使NSManagedObjectContext脏(hasChanges = YES)手动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!