question

SyahmiShafawi-3029 avatar image
0 Votes"
SyahmiShafawi-3029 asked RobCaplan edited

InstantiateViewController null when viewcontroller create in Xcode Builder Interface

After update to Visual Studio 2019 version 16.9, I started using Xcode Interface Builder to continue building your Xamarin.iOS user interfaces.

The problem is when I create new view controller in Xcode Interface Builder and InstantiateViewController, it return null. Before this update, I using Xamarin iOS designer ,it work fine.

Is there any way I can fix it?

Here some screenshot, for better view:-

  1. I create storyboard from solution
    122446-image.png

  2. I create view controller from Xcode builder interface
    122476-image.png

  3. I InstantiateViewController but return null
    122514-image.png

  4. I check in Sources Code Editor, storyboardIdentifier name is correct
    122477-screenshot-2021-08-12-at-74522-am.png


dotnet-xamarin
image.png (422.6 KiB)
image.png (119.4 KiB)
image.png (194.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SyahmiShafawi-3029 avatar image
0 Votes"
SyahmiShafawi-3029 answered

Just found the issue, my namespace in designer.cs should same namespace in viewcontroller.cs. Happy coding.

1) namespace for viewcontroller.cs
122495-image.png

2) namespace for designer.cs
122518-image.png



image.png (30.1 KiB)
image.png (17.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.