我正在尝试获取一个排序的核心数据模型,company
我目前收到一条错误消息,指出我有一个未知的接收器device
。我究竟做错了什么?
编辑:这是我收到的错误:
这是一些代码-
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// Fetch the devices from persistent data store
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Device"];
self.devices = [[managedObjectContext executeFetchRequest:fetchRequest error:nil] mutableCopy];
NSArray *sortDescriptors = @[
[NSSortDescriptor sortDescriptorWithKey:@"company" ascending:YES]
];
NSArray *sortedPeople = [self.devices sortedArrayUsingDescriptors:sortDescriptors];
NSLog(@"%@", sortedPeople);
[self.tableView reloadData];
}