NSPredicate
クラスのエンティティでフィルタリングするにはどうすればよいContact
ですか?
オブジェクト クラスクラッシュの種類の NSPredicate チェックの解決策:
[NSPredicate predicateWithFormat:@"person.class == %@", [Contact class]];
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'keypath person.class not found in entity <NSSQLEntity User id=12>'
バックグラウンド
コア データ エンティティUser
(アプリ ユーザー) とContact
(アドレス帳の連絡先) があり、どちらもPerson
(抽象エンティティ) の子です。には、 、、またはPerson
が多数identities
あります。emails
phones
usernames
NSFetchRequest
テキストメッセージのようなタイプアヘッドを作成するために、 forIdentity
エンティティを作成したいと思いperson
ますContact
。