Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Help] How to get instance of instantiated Controller in nib from Controller in another nib? (Java)



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-----

References: 
 >Re: [Help] How to get instance of instantiated Controller in nib from Controller in another nib? (Java) (From: Brendan Younger <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.