Question

  1. First i changed my NSTableView to view based and created an IBOutlet of my NSTableView.
  2. Then i dragged the Image & Text Table Cell View to it.
  3. After that i changed the NSImageView that's inside that cell view to my custom NSImageView subclass: 'PVAsyncImageView'.
  4. I imported it on my .h.

And i have this code:

- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    NSTableCellView *result = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
    [[result imageView] downloadImageFromURL:@"lol"];
    return result;
}

But it's not recognizing downloadImageFromURL (a method from my NSImageView subclass). Xcode gives me an error.
Any thoughts?

Was it helpful?

Solution

  1. Either your subclass isn't really overriding -init:, or you aren't properly loading your subclass..
  2. Be sure there's no typo in the method name on the subclass: if you have, for instance, -init: in the subclass, the superclass's -init: will still be called.
  3. Are you overriding -allocWithZone: or something somehow?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top