c# - Xamarin for iOS: All Controls null in initial view controller -
i developing storyboard application iphone xamarin.ios. app delegate - finished launching code looks follows:
public override bool finishedlaunching(uiapplication application, nsdictionary launchoptions) { //create our window window = new uiwindow(uiscreen.mainscreen.bounds) { tintcolor = uicolor.white }; //register services servicestorage.register(() => window); //apply our ui theme theme.apply(); //load our storyboard , setup our uiwindow , first view controller storyboard = uistoryboard.fromname("mainstoryboard", null); logincontroller = storyboard.instantiateinitialviewcontroller() loginviewcontroller; window.rootviewcontroller = logincontroller; window.makekeyandvisible(); return true; }
so nothing exciting here. have storyboard loginviewcontroller set initial view controller.
so here problem: @ first, reason, override viewdidload() method of loginviewcontroller being called 3 times. second, controls - have text boxes , buttons, designed storyboard designer , accessible via outlets - null during viewdidload method, time want set text / image / ..., raises error.
has had such error before? have tried using different view controller class , different appdelegate nothing seems work..
your appreciated!
thanks, leonard
so - found error... loginvc inherited basevc overridden constructor. exception raised every time constructor had been called xamarin studio not friendly enough tell me exception. well, it's working again.
Comments
Post a Comment