- Either your subclass isn't really overriding -init:, or you aren't properly loading your subclass..
- 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.
- Are you overriding -allocWithZone: or something somehow?
NSTableView view based 'Image & Text Table Cell View' not recognizing my custom NSImageView subclass
-
28-11-2021 - |
题
- First i changed my
NSTableView
to view based and created anIBOutlet
of myNSTableView
. - Then i dragged the
Image & Text Table Cell View
to it. - After that i changed the
NSImageView
that's inside that cell view to my customNSImageView
subclass: 'PVAsyncImageView'. - 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?
解决方案
不隶属于 StackOverflow