InstantiateViewController null when viewcontroller create in Xcode Builder Interface

Syahmi Shafawi 96 Reputation points
2021-08-11T23:50:11.77+00:00

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
Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Answer accepted by question author
  1. Syahmi Shafawi 96 Reputation points
    2021-08-12T02:43:54.153+00:00

    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

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.