如何将其转换为 nsurl。这是从其他工具包示例中窃取的,这可以工作,但是我需要从网站上的 .json 而不是本地 .json 文件中获取数据(这就是示例文件正在做的事情)。
- (NSFetchedResultsController *)newFetchedResultsController
{
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Contact"];
fetchRequest.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES] ];
NSFetchedResultsController *fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
managedObjectContext:self.managedObjectContext
sectionNameKeyPath:nil
cacheName:nil];
fetchedResultsController.delegate = self;
return fetchedResultsController;
}