iphone - running ios4.2 app on on simulator is OK, on devices, a NIB view is blank -
i developed iphone app in xcode 3.2.5. know version of xcode comes sdk 4.2. while testing app, set active executable ipad simulator 3.2., when executable run, 1 of views in app in blank (white), uinavigationcontroller nav bar still visible though.
this blank view happens 1 loaded nib file, other (working) views programmatically generated.
i set ios deployment target ios 3.2 in build settings.
is there reason problem? view simple, few buttons, labels , uiwebview.
edit: view constructed in ib. fwiw there handful of images in view also
update: i've since run app on devices (ipad 4.2 & iphone 3.1) same problem, particular view appears white.
in response comments; in ib set file's owner's class view controller set viewcontroller's view root view (in case uiscrollview) connecting 'dot' uiscrollview.
i don't have init method view controller, below viewdidload method.
- (void)viewdidload{ [super viewdidload]; uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemaction target:self action:nil]; self.navigationitem.rightbarbuttonitem = addbutton; self.navigationitem.title=[programme caocode]; [addbutton release]; nsmutablestring *subtitle=[nsmutablestring stringwithstring:[programme caocode]]; [subtitle appendstring:@" "]; [subtitle appendstring:[programme awardtype]]; [subtitle appendstring:@" in"]; [subtitle settext:subtitle]; [maintitle settext:[programme title]]; btncurrenttab=aboutthisprogramme; // startup active tab [details loadhtmlstring:[self getoverviewhtml] baseurl:[nsurl fileurlwithpath: [[nsbundle mainbundle] bundlepath]]]; }
finally, code instantiates problematic controller (from tableviewcontroller)
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { // create , push detail view controller. programmeviewcontroller *programmeviewcontroller = [programmeviewcontroller alloc]; programme *selectedprog = (programme *)[[self fetchedresultscontroller] objectatindexpath:indexpath]; // pass selected course new view controller. programmeviewcontroller.programme = selectedprog; [self.navigationcontroller pushviewcontroller:programmeviewcontroller animated:yes]; [programmeviewcontroller release]; }
the problem in line
programmeviewcontroller *programmeviewcontroller = [programmeviewcontroller alloc];
if loading nib file should like
programmeviewcontroller *programmeviewcontroller = [[programmeviewcontroller alloc] initwithnibname:@"mynibname" bundle:nil];
"mynibname" should file name of nib without .xib file extension. make sure of course nib file included in build.
Comments
Post a Comment