Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1403 [details]
Example of Problem under Mono Touch
We're having difficulty using any NIB based dialogs that are stored in projects outside of the "Executable" project in MonoTouch and MonoMac. I've attached an example for MonoTouch.
Created attachment 1404 [details]
Same issue under MonoMac
I'm not entirely sure about this, but I don't think this is a supported scenario.
It is supported for MonoTouch, but not for MonoMac.
MD embeds the nibs into the dll with an encoded name when building the library, and unpacks them when building the app. mtouch then strips the resources from the linked dlls.
The nibs from the library appear to have been unpacked into the app bundle, what's not working?
Try running the MonoTouch example, you don't see the label that Library.MyControls's nib has. Open up AppDelegate.cs and compare the commented out code (that works) with the uncommented out code (that doesn't).
I wonder whether it has something to do with bug 3098?
I think the root issue is that nib files not referenced in the main exe project don't seem to be deployed in the Contents/Resources directory.
(Sorry for the bug spam).
If I add a reference to the nib file manually and force a rebuild it gets deployed.
I assume you're talking about MonoMac in your last two comments? If so, could you please open a separate bug? It's a completely different issue.
MonoMac currently doesn't support bundling nibs from referenced projects and dlls. This feature would ideally be done the same way as MonoTouch if/when it's added.
MonoTouch is different because it's a supported feature, and the nibs appear to be copied into the output directory correctly. We need to dig deeper to find out why they're not working.
Correct. I filed https://bugzilla.xamarin.com/show_bug.cgi?id=3611 for the MonoMac issue in particular.
So I tested the demo and, as you said, it doesn't seem to work but I don't understand why not: the MyController_*.nib's are in the .app directory alongside the MonoTouchDemoViewController_*.nibs, which afaik is right where they should be, right?
Where does iOS expect them to be if not there?
Interesting note: if I change the string passed to base() in the MyController ctor, I get an exception about the nib not being found in the app bundle.
So... since we're not getting that error if I leave that string unchanged, it suggests to me that the CocoaTouch libs are finding/loading it just fine.
So why aren't they loading the UI elements?
Reassigning to the MonoTouch team as this doesn't appear to be anything that MonoDevelop is doing wrong.
There's a bug in your source code, for the library xib you do:
This code works for me:
myController = new Library.MyController();
window.RootViewController = myController;