Thursday, 15 January 2015

objective c - View not visible until multitasking bar is opened - iPhone -



objective c - View not visible until multitasking bar is opened - iPhone -

i first got auto layout crash when running on iphone 3.5 inch display ios 5.1 - fixed turning off auto layout. but, now, when run app, screen black. view visible when double tap home button evoke multitasking bar. weird, right?

on app startup:

when evoking multitasking.

code snippet:

if(screensize.height == 480) { // iphone classic welcomeviewcontroller = [welcomeviewcontroller initwithnibname:@"welcomeviewcontroller~iphone3.5" bundle:nil]; viewcontroller = [viewcontroller initwithnibname:@"selectzone~iphone3.5" bundle:nil]; fixtureviewcontroller = [fixtureviewcontroller initwithnibname:@"fixture~iphone3.5" bundle:nil]; [windowoldiphone addsubview:fixtureviewcontroller.view]; [windowoldiphone addsubview:viewcontroller.view]; [windowoldiphone addsubview:welcomeviewcontroller.view]; [windowoldiphone makekeyandvisible]; [windowoldiphone bringsubviewtofront:welcomeviewcontroller.view]; }

note: doesn't happen on iphone/ipad running ios 6.

call bringsubviewtofront before calling makekeyandvisible. below

if(screensize.height == 480) { // iphone classic welcomeviewcontroller = [welcomeviewcontroller initwithnibname:@"welcomeviewcontroller~iphone3.5" bundle:nil]; viewcontroller = [viewcontroller initwithnibname:@"selectzone~iphone3.5" bundle:nil]; fixtureviewcontroller = [fixtureviewcontroller initwithnibname:@"fixture~iphone3.5" bundle:nil]; [windowoldiphone addsubview:fixtureviewcontroller.view]; [windowoldiphone addsubview:viewcontroller.view]; [windowoldiphone addsubview:welcomeviewcontroller.view]; [windowoldiphone bringsubviewtofront:welcomeviewcontroller.view]; [windowoldiphone makekeyandvisible]; }

iphone objective-c

No comments:

Post a Comment