iphone - UINavigationcontroller initWithRootViewController from appDelegate, empty view? -


i ran problem.

i want initialize uinavigationcontroller uiviewcontroller. viewcontroller gets loaded .xib using

uinavigationcontroller *mynavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:appdelegate.myviewcontroller]; 

[self presentmodalviewcontroller:mynavigationcontroller animated:yes];

unfortunately view empty.

am doing wrong or there other way achieving aim?

if allocating instance of viewcontroller so

uiviewcontroller *acontroller = [[uiviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]]; 

and having button inside nib, app crashes when tapping on it.

thanks lot.

myviewcontroller *acontroller = [[myviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]];

or

uiviewcontroller *acontroller = [[myviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]];

then push

since

if u type this

uiviewcontroller *acontroller = [[uiviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]];

u allocating uiviewcontroller , doesn't know ur button in default uiviewcontroller

which means n't have uibutton property.

so crashes


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -