0
//list has type of NSMutableArray
NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES] autorelease];
[list sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
我得到这个异常: 终止应用程序由于未捕获的异常“NSUnknownKeyException”,原因:“[< __NSDate 0x5d57980> valueForUndefinedKey:]:这个类不是关键值编码 - 符合关键日期。'异常它包含所有的NSDate对象
有什么想法?如何解决它?
谢谢!其实首先我想我需要定义比较:,但实际上比较:在系统中定义,是正确的? – zsong 2010-07-25 14:41:51
@sza:[Yes](http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDate/比较:)。 – kennytm 2010-07-25 14:43:41