[Mono-osx] NIB files in non-executable assemby problem

Chris Hamons chris.hamons at ni.com
Thu Feb 9 17:32:11 UTC 2012


I'm working with monomac and am trying to port some code. I'm unsure if 
this is a problem with my code, with my project build settings, or an 
actual bug. Any help would be appreciated:

I have two assemblies of interest, one setup as a Library and the other as 
an Executable (that depends on the Library). The code in question is 
roughly:

Executable Assembly:

        static void Main (string [] args)
        {
            MyApplication.Run();
        }

Library Assembly:

        (MyApplication)
        public static void Run()
        {
            try
            {
                NSApplication.Init ();
                NSApplication.Main(new string[] {});
            }
            catch (Exception exception)
            {
            }
        }

 
       (AppDelegate)
       public override void FinishedLaunching (NSObject notification)
       {
             mainWindowController = new MyController();
             mainWindowController.Window.MakeKeyAndOrderFront(this);
       }


        // Call to load from the XIB/NIB file
        public MyController() : base ("MyController")
        {
            Initialize ();
        }


The Library Assembly also contains MyController.xib.


If I run the project as listed, mainWindowController.Window is null (and 
thus I crash) and in some conditions I get a print to Application Output 
about difficulty finding the xib file. 

If I add a reference to MyController.xib in my executable assembly then I 
see my window just fine.

Is there any way I can make this work without having to add this 
reference? I've tried changing the build setting in MyController.xib in 
the Library assembly to no effect.

If my example is unclear, I can create a simple project that shows this if 
necessary.

Thanks,
--Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120209/208a133d/attachment.html>


More information about the Mono-osx mailing list