문제

  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?

도움이 되었습니까?

해결책

  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?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top