I have done this successfully many times before, but this time it just won’t work.
The code in my .h file:
@interface Images : NSView {
}
- (void) draw;
@end
The .m file (of another object):
- (IBAction) go: (id) sender; {
[Images draw:nil];
}
When I try to compile this, it says the following:
'*' may not respond to '*
Images may not respond to '+draw'
This has me quite confused. Shouldn’t this be working?
Please Note: Yes, I have seen the other questions about messages, but none of those answers was even partially helpful for me. After reading them, I was even more confused.
Your
drawmethod is an instance method: it can only be called on instances of theImagesclass. In yourgo:method you’re trying to call it as a class method—if this is what you want, change it to: