【发布时间】:2011-08-24 00:05:28
【问题描述】:
//设置通知
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(dataChanged:)
name:NSManagedObjectContextDidSaveNotification
object:context];
//稍后
- (void)dataChanged:(NSNotification *)notification{
NSDictionary *info = notification.userInfo;
NSSet *insertedObjects = [info objectForKey:NSInsertedObjectsKey];
NSSet *deletedObjects = [info objectForKey:NSDeletedObjectsKey];
NSSet *updatedObjects = [info objectForKey:NSUpdatedObjectsKey];
是否可以从 updatedObjects 中确定实际更改了哪些字段?
谢谢, 迈克尔
【问题讨论】:
标签: ios objective-c core-data nsmanagedobjectcontext