English 中文(简体)
基于核心数据属性的 UITable View 区域
原标题:UITableView Sections based on Core Data attribute

在我的应用程序中, 我有一个 UIT View, 由核心数据组成, 目前是一个名为“ name ” 的字符串 。 我希望能够将这个表格视图分为三个部分, 名称可以是 0, 1 和 2, 或 1, 2 和 3 。 这个名称并不真正重要 。 目前我真的不知道如何实现这一点 。 在我的数据模型中, 我有一个名为“ term ” 的新属性, 也就是我要将各部分作为基础的属性 。 这样做是否最好是一个整数?

我对iOS开发是一个新人, 所以如果有人知道怎么做, 我会非常感激。

在这里,我目前的代码排序 以“ 姓名” 属性来填充表格视图 。

- (void)setupFetchedResultsController
{
    //1 - Entity
    NSString *entityName = @"Task"; // Put your entity name here
    NSLog(@"Setting up a Fetched Results Controller for the Entity named %@", entityName);

    //2 Request
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:entityName];

    // 3 - Filter
    //request.predicate = [NSPredicate predicateWithFormat:@"Task.name = name"];

    // 4 - Sort
    request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name"
}

谢谢大家!

最佳回答

我不明白您是否使用 < code> NSFededResults current 。

在第一种情况下(你使用它),你可以利用它设置 term 作为区域分隔的属性。当您创建了 NSFededresutedResults current 您可以通过

在第二种情况下,我确实建议在处理 NSFletedResults current 时处理 >UITableView 。 设置 NSFletedResults current 是一个真正的样本, 因为您需要创建它, 并通过一个 NSFetchrestExpress 。 您创建的代码是可以的 。

关于进一步的信息,我建议改为,以及NSFededResults concroscrosults concern lease referance

希望能帮上忙

问题回答

暂无回答




相关问题
selecting textareas

I am trying to select specific element types in a row and change their attribute, specifically the id and name attributes. Using the following works fine for single line text input boxes: $( input:...

Performance overhead of using attributes in .NET

1.. Is there any performance overhead caused by the usage of attributes? Think for a class like: public class MyClass { int Count {get;set;} } where it has 10 attibutes (...

How to remove "onclick" with JQuery?

PHP code: <a id="a$id" onclick="check($id,1)" href="javascript:void(0)" class="black">Qualify</a> I want to remove the onclick="check($id,1) so the link cannot be clicked or "check($id,...

Unit Test for Exceptions Message

Is there a simple (Attribute-driven) way to have the following test fail on the message of the exception. [TestMethod()] [ExpectedException(typeof(ArgumentException))] public void ExceptionTestTest() ...

热门标签