要するに :
@property
エンティティを取得し、ではないに従ってそれらをソートすると、2 回目の実行時にattribute
(関連する) バグが発生しNSDictionaryMapNode
ます。
それは正常ですか、それともバグですか?それについてコメントやヘルプはありますか?
長い :
状況は以下です。
Entity
と の2 つの属性を持つ がattribute1
ありますattribute2
。
[1]クラスを生成し、 という名前のクラスEntity.m
を追加しました。したがって、は私のクラスですが、エンティティの属性ではありません。ちなみに、は(と連結したようなものだとしましょう。@property
myProperty
myProperty
@property
Entity.m
Entity
myProperty
readonly
attribute1
attribute2
今、私は次のことを行います:
NSManagedObjectContext * myContext = ... ;
NSFetchRequest * myRequest = [NSFetchRequest fetchRequestWithEntityName:@"Entity"];
NSSortDescriptor * mySortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"myProperty"
ascending:YES] ;
NSError *error ;
[myRequest setSortDescriptors:@[mySortDescriptor]] ;
NSArray * result = [myContext executeFetchRequest:myRequest
error:&error] ;
このコードが初めて実行されるとき、バグはありません。
2 回目は、次のバグが発生します。
[<NSDictionaryMapNode 0x1020cf310> valueForUndefinedKey:]: this class is not key value coding-compliant for the key myProperty.
myProperty
の属性ではないことに問題があることは理解していますEntity
。私の投稿の目的は、この状況を提起し、この状況について何かコメントがあるかどうかを知ることです.