应用程序终止后,Magical Record Truncate不工作 [英] Magical Record Truncate not working after app terminate
本文介绍了应用程序终止后,Magical Record Truncate不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hey all我有这样的代码
hey all i've code like this
if ([cellValue isEqualToString:@"Logout"])
{
NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread];
[EUserBrief MR_truncateAllInContext:localContext];
[DownloadList MR_truncateAllInContext:localContext];
}
代码我要截断实体上的所有数据[EUserbrief] ] ..代码工作正常,但应用程序终止后,我得到,EuserBrief数据和下载列表仍然在那里,这个任何解决方案?
the code i want to truncate all data on entities [EUserbrief] and [DownloadList].. the code working fine, but after app terminate and i get in , EuserBrief data and downloadlist still there,,, any solution for this?
推荐答案
您需要调用
[localContext MR_save];
您的更改不会保存到任何数据存储中。
Your changes will not be persisted to any data store without saving.
这篇关于应用程序终止后,Magical Record Truncate不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文