当我在Eclipse中编辑XML文件(主要是Android布局等)时,它会导致XServer出现泄漏,它会结束我所有的RAM(4GB),所以我必须按Ctrl + Alt + Backspace继续.
你知道任何补救措施吗?
我遇到了一个问题,我不知道它来自哪里,与CoreData相关.在我的数据库中,a有一组类别(带名称和描述),其中包含元素(使用一对多关系).
我想在给定Category类的属性的部分中划分我的表视图,但是当我尝试使用时sectionNameKeyPath:,结果NSFetchedResultsController有0个部分.如果我将nil传递给此参数,则它有1个部分.
代码如下:
- (NSFetchedResultsController*) fetchedResultsController
{
if(fetchedResultsController)
return fetchedResultsController;
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
// Edit the entity name as appropriate.
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Category"
inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
// Set the batch size to a suitable number.
[fetchRequest setFetchBatchSize:10];
// Edit the sort key as appropriate.
NSSortDescriptor *checkDescriptor = [[NSSortDescriptor alloc] initWithKey:@"checked"
ascending:YES];
NSSortDescriptor *indexDescriptor = [[NSSortDescriptor alloc] initWithKey:@"orderIndex"
ascending:YES];
NSArray *sortDescriptors = @[checkDescriptor, indexDescriptor];
[fetchRequest setSortDescriptors:sortDescriptors];
// Edit the section …Run Code Online (Sandbox Code Playgroud)