내가 당신이라면, 실제로 대표가 아닌 다른 뭔가를 할 것이다 : 나는 알림을 사용합니다.
"NSManagedObjectContextDidSaveNotification"을 관찰 할 수 있으며 웹 서비스의 변경 사항을 저장하면보기 컨트롤러에서 활동을 대기시킬 수 있습니다.
:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(managedObjectContextDidSave:) name:NSManagedObjectContextDidSaveNotification object:nil];
}
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
그리고 당신이해야 할 모든 변화를 관찰 할 수 있습니다 :
그래서, 뷰 컨트롤러 마감이 때 뷰 컨트롤러를 만들 때이 준수를 시작하고 싶어, 마무리 말
- (void)managedObjectContextDidSave:(NSNotification *)notification {
// Update your stuff here.
}
테이블을 특정하게 만들 수있는 방법이 있습니까? 특정 테이블에 대한 변경 사항에 대한 알림 수신 또는 확인? – rckehoe
죄송합니다. 올바른 용어는 테이블이 아닌 "엔터티"입니다. 그러나 기술적으로, 그것은 같은 것입니다 :) – rckehoe