I can access an app-wide delegate instance using [NSApp delegate]
after adding an NSObject
to the mainmenu.xib, setting the name of the object to the name of my appDelegate and setting the mainmenu.xib delegate to this object.
Now, what I would like to do, is to access to an object's Document, i.e. the active NSDocument
that the object "belongs" to. It would be a doc-wide delegate instance I guess. Sometimes [self document]
works, but not always. Is there a generic way?