I have made some code to do this, but as It doesn’t work. I am only a beginner so I may be doing this completely wrong or i may have missed something out. Either way please tell me. Here is the code I have got.
[item setAction:(SEL)action {
[window makeKeyAndOrderFront:NSApp];
}
It looks like you’re trying to make an anonymous function. AFAIK, Obj-C has no support for these. Basically want you want to do is define
actionas a proper method:…
Also, I’m not sure why you’re passing
NSApptomakeKeyAndOrderFront:. The full signature is- (void)makeKeyAndOrderFront:(id)sender, so passingselfis usually most appropriate (although I’m not even sure what that input does!).I suggest you work through a few tutorials to familiarize yourself with Obj-C and Cocoa.