我想從具有固定節的tableview中將數據從NSManagedObject獲取到新的單元格。如何將新單元格添加到固定的UITableView?
第一部分是固定部分。第二部分是用戶可以添加新數據的位置。單獨顯示固定部分是沒有問題的,也可以將動態內容分開顯示。但是當我將它們結合在一起時,我被這種方法困住了(見下面的'rows = ???')。通常你可以通過[數組數]方便地解決這個問題,但是我的ManagedObjects不會被收集到一個數組中。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
//return [sectionInfo numberOfObjects];
NSInteger rows = 0;
switch (section) {
case FIXED_SECTION:
rows = 4;
break;
case LIST_SECTION:
{
rows = ???;
break;
}
default:
break;
}
return rows;
}