@interface Keyword : NSManagedObject
@property (nonatomic, retain) NSString * thekeyword;
@property (nonatomic, retain) NSSet *businesses;
@property (nonatomic, retain) NSSet *catalogWithThisKeywords;
@property (nonatomic, retain) NSSet *images;
@property (nonatomic, retain) CategoryNearby *shortCutSearches;
@end
リクエストをソートして取得したいbusinesses.count
だから私はこの要求をします:
(lldb) po request
(NSFetchRequest *) $4 = 0x089ccca0 <NSFetchRequest: 0x89ccca0> (entity: Keyword; predicate: (TRUEPREDICATE); sortDescriptors: ((
"(businesses.count, ascending, compare:)",
"(thekeyword, ascending, compare:)"
)); type: NSManagedObjectResultType; returnsObjectsAsFaults: NO; )
最初の sortDescriptors としての business.count に注意してください
結果は次のとおりです。
2013-01-07 16:19:50.391 BadgerNew[88578:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSDictionaryMapNode 0x89c4720> valueForUndefinedKey:]: this class is not key value coding-compliant for the key count.'
*** First throw call stack:
(0x2208022 0x1d8ecd6 0x2207ee1 0x149eefe 0x140d831 0x140cc99 0x1a22c08 0x143eae2 0x14108c5 0x143f911 0x141087c 0x143e18b 0x1440904 0x1a212e9 0x1a20229 0x1a2004b 0x19a945d 0x19a72fd 0x465bf 0x46372 0x10d443 0x10cedb 0x142f63e 0x14281e7 0x1427eea 0x14b80ad 0x1f65330 0x1f67509 0x213f803 0x213ed84 0x213ec9b 0x292b7d8 0x292b88a 0xaf1626 0x252d 0x2455)
うーん.....どうしたの?
someKeyword.businesses のタイプは、サポートする NSSet ですcount
。