Hi List,

I have a warning that I’m trying to understand.  Hopefully someone here can 
shed some light on it.

I have two relevant classes.  My window controller:

@interface ISWindowController : NSWindowController <NSToolbarDelegate>
…
- (IBAction)clear: (id)sender;
...
@end

This method is implemented and works as expected if called directly.  (It 
clears the search field in the toolbar.)

In the second class, an NSArrayController subclass, I have the following method 
override:

- (id)newObject {
        NSManagedObject *newObject = [super newObject];
        ...
        // Clear the Search Field via the Window Controller (Responder Chain)
        [NSApp sendAction: @selector(clear:) to: nil from: table];
        …
}

sendAction:to:from: seems to be the preferred way to invoke the responder chain 
to implement the clear: method in the Window controller.  However, it generates 
the following warning:

“Creating selector for nonexistent method ‘clear:’

I can’t figure out how to get rid of this warning.  The window controller’s 
header file is imported into the second class.  Removing the import causes a 
second warning to be generated on the same line, which is what I expected 
(Undeclared selector).  I’ve also tried using other ways of invoking the 
responder chain, like tryToPerform:with: on the table the Array Controller is 
managing.  It seems to be any attempt to use @selector() that is causing the 
warning.

I know how to turn off this warning, what I’d like to understand is why it’s 
coming out at all.  I thought I was doing everything right here.

Thanks for any insights,
Arved
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to