我有一個應用程序,與核心數據的工作。數據有一個日期字段,我想在一個單獨的部分顯示每個月的每個條目。CoreData和的UITableViewController問題
如何真正得到的數據?我使用NSFetchedResultsController來獲取數據,並使用此:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
id <NSFetchedResultsSectionInfo> sectionInfo = [[_fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}
讓行和這樣的:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyInfoObject *info = [_fetchedResultsController objectAtIndexPath:indexPath];
}
讓我的實際數據對象。
感謝
你可以添加你如何設置讀取的結果控制代碼的時候請確保您設置sectionNameKeyPath?這是部分設置的地方。 – 2010-06-01 20:43:39