0

行ごとにフェッチされた結果コントローラーを使用してアイテムをフェッチするテーブルビューコントローラーがあります。行が選択されると、その特定のマネージド オブジェクト モデルを編集するために新しいビュー コントローラーがプッシュされます。編集して保存しようとすると、次のようになります。原因は何ですか?ありがとう

Serious application error.  Exception was caught during Core Data change processing.  This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification.  Can't use in/contains operator with collection 0 (not a collection) with userInfo (null)
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] in image CoreData

.

4

1 に答える 1

3

エラーのこの部分:

...Can't use in/contains operator with collection 0 (not a collection)...

通常、不適切な述語を示します。最も可能性が高いのは、fetch または fetched 属性です。ほとんどの場合、対象となるオブジェクトの属性が含まれる可能性のある値の実際のコレクションを提供せずに、述語でINor演算子を使用しようとしました。たとえば、CONTAINS

NSPredicate *p=[NSPredicate predicateWithFormat:@"attribute1 IN %@", @"a string not an array"];

...対:

NSArray *inCollection=[NSArray arrayWithObjects:@"Tom",@"Dick",@"Harry",nil];
NSPredicate *p=[NSPredicate predicateWithFormat:@"attribute1 IN %@", inCollection];

おそらく、編集で変更しているものは、テーブルのフェッチで述語を壊しています。また、オブジェクトが挿入、削除、または変更された場合に、それらの変更を反映するようにテーブルが適切に更新されるように、フェッチされた結果コントローラーのデリゲート メソッドを実装したことを確認する必要があります。

(残りのエラーは無関係です。これは、何もできないフレームワークの警告です。)

于 2011-03-09T15:54:09.883 に答える