Phone の [最近] タブのように、UITableView で同様の行をロールアップする最良の方法は何ですか? Core Data を使用しており、現在、NSManagedObject の「タイムスタンプ」フィールドに基づいてデータを時系列で表示しています。iPhone の最近のテーブルは、冗長なデータを圧縮するために行を 1 つの行にグループ化します。
これを達成するための最良の方法は何ですか?

Phone の [最近] タブのように、UITableView で同様の行をロールアップする最良の方法は何ですか? Core Data を使用しており、現在、NSManagedObject の「タイムスタンプ」フィールドに基づいてデータを時系列で表示しています。iPhone の最近のテーブルは、冗長なデータを圧縮するために行を 1 つの行にグループ化します。
これを達成するための最良の方法は何ですか?

Apple にはコード内でより簡単な方法があると確信していますが、ここに私が思いついたものがあります。メソッドでインスタンス化する1 NSArray(いくつかの生データを含む) と、.h ファイルでプロパティとして宣言される (および遅延インスタンス化される) 2 があります。これが私のコードです。viewDidLoadNSMutableArray
.h
@interface RollUpTableViewController : UITableViewController
@property (strong, nonatomic) IBOutlet UITableView *rollUpTableView;
@property (strong, nonatomic) NSMutableArray *names;
@property (strong, nonatomic) NSMutableArray *countOfNames;
@end
.m
-(NSMutableArray *)names{
    if(!_names) _names = [[NSMutableArray alloc]init];
    return _names;
}
-(NSMutableArray *)countOfNames{
    if (!_countOfNames) _countOfNames = [[NSMutableArray alloc] init];
    return _countOfNames;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    NSArray *rawData = [[NSArray alloc] initWithObjects:@"Jack", @"Jill", @"Jill", @"Ryan", @"Bill", @"Ryan", @"Ryan", @"Ryan", @"Steve", @"Katie", @"Jill", @"Ryan", @"Ryan", nil];
    int countOfLikeNames = 0;
    int i=0;
    for (i = 0; i < [rawData count]; i++){
        if (i == 0) {
            //Putting the first name in the names NSMutableArray no matter what
            [self.names addObject:[rawData objectAtIndex:i]];
            countOfLikeNames = countOfLikeNames + 1;
        } else {
            //Checking if the current name is the same as the previous
            if ([rawData objectAtIndex:i] == [rawData objectAtIndex:(i-1)]) { 
                countOfLikeNames = countOfLikeNames + 1;
            } else {
                //Once it runs into a difference in names, add the final count to the countOfNames NSMutableArray
                [self.countOfNames addObject:[NSNumber numberWithInt:countOfLikeNames]];
                //Starting the count over
                countOfLikeNames = 1;
                //Adding the next name
                [self.names addObject:[rawData objectAtIndex:i]];
            }
        }
        //if the for loop is on its last iteration, add what will be the last object for countOfNames
        if (i == ([rawData count] - 1)) {
            [self.countOfNames addObject:[NSNumber numberWithInt:countOfLikeNames]];
        }
    }
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.names count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    cell.textLabel.text = [self.names objectAtIndex:indexPath.row];
    cell.detailTextLabel.text = [[self.countOfNames objectAtIndex:indexPath.row] stringValue];
    return cell;
}
@end
私は少し怠け者で、UITableViewCell で Apple のビルトイン 'Right Detail' スタイルを使用しました。これが生データの結果です。

CoreData から取得したタイム スタンプを比較する必要がありますが、これがコンセプトの理解に役立つことを願っています。