我想在我的NSTableView
中实现延迟加载,我正在显示来自网址的图片,因此我的NSTableView
滚动得不好。我从最近几个小时谷歌搜索。 UITableView
有很多教程,但是NSTableView
MAC OS X没有教程。任何人都可以帮助我。
我正在使用以下代码。
-(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
// Get a new ViewCell
NSTableCellView *cellView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
NSString *identifier=[tableColumn identifier];
NSLog(@"identifier is %@",identifier);
if( [tableColumn.identifier isEqualToString:@"MainCell"] ){
NSURL *url = [NSURL URLWithString:[artUrl objectAtIndex:row]];
NSImage *image = [[NSImage alloc] initWithContentsOfURL:url];
cellView.imageView.image = image;
cellView.textField.stringValue = [stationName objectAtIndex:row];
return cellView;
}
由于