ios - Accessing Storyboard from Class in Objective-C -
i have object of viewcontroller class in file, not in vc.h/.m. vc.h hooked main.storyboard. i'm not sure how alter label.text of storyboard label viewcontroller object created in file.
i informed had nib file of main.storyboard or line of code:[uistoryboard storyboardwithname:(nsstring *)main bundle:(nsbundle *)nil]; storyboard file default main.storyboard
i have initialized labels of vc object so: self.myvcobject.label1 = [uilabel new] , changed value: self.myvcobject.label1.text = @"stackoverflow" ; nil displayed in ios simulator when app run. problem due vc object beingness not linked storyboard? how prepare problem?
uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; myviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier:@"myviewcontrollerwithlabel"]; vc.label1.text = @"hello world";
ios iphone objective-c xcode uiviewcontroller
No comments:
Post a Comment