I am adding a menu item programmatically:
refreshItem = [[NSMenuItem alloc] initWithTitle:@"Refresh" action:@selector(refreshMenu) keyEquivalent:@""];
The refreshMenu method is called fine if it’s an instance method, but I want to turn it into a class method:
+(void)refreshMenu {}
How would I reference it then?
You’d still use
@selector(refreshMenu), but you’d set the-targetof theNSMenuItemto be theClass(ie,[self class]) instead of the instance (self).