Forum Xamarin.iOS

how to select outlets in VS2019

tati2211tati2211 Member ✭✭
edited January 29 in Xamarin.iOS

hi! im new in xamarin ios and i get "Loaded nib but the 'view' outlet was not set" exception.
Stakowerflow answer seems suitable for this case (stackoverflow.com/a/30662586/9127181)

, but i cant find how to set otlet (steps 4 and 5 in VS2019 - screen attached).

Pls Help

Tagged:

Best Answer

Answers

  • tati2211tati2211 Member ✭✭
    edited February 1

    @LandLu said:
    Here is documentation demonstrating how to connect the xib file to a backing class:
    https://github.com/xamarin/docs-archive/tree/master/Recipes/ios/general/templates/using_the_ios_view_xib_template
    Select the view in the xib file and type in the class name in the class entry. Then click Enter key, Visual Studio will help you generate the corresponding backing class:

    Do not forget to create an instantiating method so that we could consume it somewhere else:

    public static SomeView Create()
    {
              
      var arr = NSBundle.MainBundle.LoadNib ("SomeView", null, null);
      var v = Runtime.GetNSObject<SomeView> (arr.ValueAt(0));
          
      return v;
    }
    

    Many thanks for your explanation!

Sign In or Register to comment.