ios - Can't call ViewController method from AppDelegate -


in appdelagate call following in method

func example() {     viewcontroller().test() } 

and in viewcontroller method is

func test() {     testview.userinteractionenabled = true     buttontapped(uibutton())     restarttimer() } 

but crashes whenever call method, due nil error testview. testview view in viewcontroller , not in appdelegate, don't know how make method executes how if called in viewcontroller.

an iboutlet nil until view controller calls viewdidload. viewdidload did not occur since tried instantiate class directly via call viewcontroller().

thus, testview nil, expected. appdelegate should not responsible viewcontroller logic anyhow.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -