2011-02-09 5 views
3

私は、一対一の関係でリンクされた2つのエンティティを持つモデルを持っています。私は、entityB.myIntAttributeが与えられた値と等しいすべてのEntityAオブジェクトをTableViewに表示したいと思います。これは、 "entityB.myIntAttribute == aValue"という述語でEntityAのFetchRequestを作成するときに機能します。NSFetchedResultsControllerはリレーションシップを超えてトラッキングを変更します

私の問題は変更の追跡にあります。以前のFetchRequestに関連付けられたNSFetchedResultsControllerでNSFe​​tchedResultsControllerDelegateデリゲートを設定しました。このデリゲートは、結果のいずれかの述語と一致しない新しいエンティティBを設定した場合、削除が通知されるため機能します。しかし、述語の結果が変わるようにentityBオブジェクトのmyIntAttributeの値を直接変更すると、代理人に変更が通知されません。

NSFetchedResultsControllerは、関係を横断する述語でトラッキングの作業を変更しますか? FetchedResultControllerは、関係の属性の変更後にどのように述語を再計算できますか?

+0

を、コメントは私が十分な文字を追加できません。 – afrederick

答えて

-1

あなたのデリゲートでは、次の方法の全て実装されています。下記の私の答えを参照してください

- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type 

- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath 

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller 

- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller 
関連する問題