RE: [Help] How to get instance of instantiated Controller in nib from Controller in another nib? (Java)
RE: [Help] How to get instance of instantiated Controller in nib from Controller in another nib? (Java)
- Subject: RE: [Help] How to get instance of instantiated Controller in nib from Controller in another nib? (Java)
- From: "Mark Orchard" <email@hidden>
- Date: Fri, 20 Jul 2001 21:08:55 +1000
Brendan,
Will you please explain the second part of your answer in more detail?
I tried the following from an button's action method in my second nib
(NSPanel dialog that appears above my main window) to try and access a
public method in my MainMenu.nib's "MyMainController" class (i.e. the app.
delegate).
NSBundle appBundle =
NSBundle.bundleForClass(Class.forName("MyMainController"));
Class mainClass = appBundle.principalClass();
The application bundle is returned correctly in appBundle. Unfortunately,
mainClass returns null.
Note,
((MyMainController)NSApplication.sharedApplication().delegate()).wantedMetho
d();
works but only because MyMainController is my app's delegate.
Regards,
Mark
-----Original Message-----