ios - UIViewController incorectly shows on its side -
i have 2 views, when app loads if prefs match users log in trying load next viewcontroller immediatly.
each view shows in landscape , have set apps settings allow landscape. when try load second view immediatly first view "viewdidload" second view appears on side.
this code looks like, code in method gets called first viewcontrollers viewdidload
currentprojectlistviewcontroller = [[currentprojectlistviewcontroller alloc] initwithnibname:@"currentprojectlistviewcontroller" bundle:nil]; [currentprojectlistviewcontroller setdelegate:self]; // set delegate can access returning method update view uiwindow* keywindow= [[uiapplication sharedapplication] keywindow]; [keywindow addsubview: currentprojectlistviewcontroller.view]; [self presentviewcontroller:currentprojectlistviewcontroller animated:no completion:nil];
i have no idea start this. makes second views viewdidload how ever view appears correct on side effectivly 90degrees incorrect.
any making sure apperar in landscape appreciated.
i think view hierarchy wrong.
why adding view
of currentprojectlistviewcontroller
uiwindow
object , after adding subview
presenting using presentviewcontroller
current viewcontroller?
when load , show second viewcontroller, presentviewcontroller
code should work. dont need play uiwindow
object. make sure dismiss present view controller reduce memory footprint , memory leaks.
Comments
Post a Comment