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 1513 [details]
If you use the "iPhone View" template in MD to create a new xib file, and then load it in code, e.g.:
public Controller () : base("PortraitView_iPhone", null)
You'll receive an error saying that the nib was loaded but that the view outlet was not set.
perhaps our view template is broken?
repro project attached. launch and click the third button.
This is not a bug as such as this is also what Xcode does. The issue here is that when you create a normal View Controller, xcode generates a xib file which connects to the 'view' outlet . This means by default, everything will work for you.
However, if you manually create a class which derives from UIViewController and add a new iPhone or iPad View, this xib file does not connect to the 'view' outlet. i.e. it does not contain the connection in the previous gist. We can 'fix' this by default by generating this connection in the 'iPhone View' and iPad View templates such as this .
The other option is that users must be made aware that to make this work they must:
1) Create their controller subclass
2) Add a Register attribute so that it will be made available to obj-c
3) Double click the xib to sync out to xcode
4) Set the 'Custom Class' to the name of the controller you made in your code
5) Create an outlet to connect the 'view' object in your xib to a new outlet called 'view'
6) Save and exit xcode
7) Open the .designer.cs file and delete all references to the 'view' outlet
Some of those steps may be optional, but this is what I did to make bryans solution work correctly. Is there any problem with the solution i proposed in ? If not, I will push this to git.
Not sure on this one. Adding the connection means we expect the file's owner to have an outlet called View. That might not be true, for example if the user is deserializing a nib directly, in which case they'd have to *remove* the connection.
This is why we have a "view with controller" template.
Also, your comment is wrong. UIViewController already *has* an outlet called view, you should never create a new one.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Not sure why this is in NEEDINFO.
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.
Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.
No clue what to do about this except maybe remove stand-alone xib templates?
i think we should do alan's  fix.
Michael's comment explains why we can't do Alan's suggestion, though.