2
我對indexPath和indexPath.row感到困惑,tableView中的每個單元格是否對應一個indexPath?那麼爲什麼我們要查找這個indexPath的「行」呢?我查了文件,但我認爲它讓我困惑。indexPath和indexPath.row之間的區別(iphone)
,我發現這個代碼:
// this method is used in case the user scrolled into a set of cells that don't have their app icons yet
- (void)loadImagesForOnscreenRows
{
if ([self.entries count] > 0)
{
NSArray *visiblePaths = [self.tableView indexPathsForVisibleRows];
for (NSIndexPath *indexPath in visiblePaths)
{
AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];
if (!appRecord.appIcon) // avoid the app icon download if the app already has an icon
{
[self startIconDownload:appRecord forIndexPath:indexPath];
}
}
}
}
你能解釋我這兩者之間的區別?
非常感謝
保羅
好的,謝謝evgeniy – Paul