ios - UINavigationController pushViewController not working -


i have double-tap gesture on view controller irpimageviewerviewcontroller (topmost on navigation stack), , each time view on irpimageviewerviewcontroller double-tapped, pushes image editor view controller irpimageeditorviewcontroller onto stack, that's why there several of them, none of appeared. each time double-tap, it's added, never appears. self class houses double-tap gesture irpimageviewerviewcontroller, , in fact have navigationcontroller per lldb output

po self.navigationcontroller returns navigation controller expected.

po self.navigationcontroller viewcontrollers shows new view controller being added list each pushviewcontroller statement encountered, yet pushed item won't show on screen.

i shouldn't have push , move front, right?? doesn't push automatically make frontmost view controller?

note navigation controller not root controller in hierarchy, starting window. have full screen map view controller, half-screen 'dashboard' view controller, within have window on dashboard has picture, , picture view controller. starting picture view controller, shown here, can walk through happens

@implementation irpdashboardheaderimagesviewcontroller {     iggridview *thegridviewcontrol;     uiview *thegridparentview;     irpimageset *thepropertyimageset;     irpdashboardviewcontroller *dashboardviewcontroller;     uiimageview *primaryimagemarker;     uinavigationcontroller *imageeditornavcontroller;     irpimageviewerviewcontroller *imageviewervc; }       -(id)initwithparentviewcontroller:(irpdashboardviewcontroller*)parentcontroller     {         self = [super init];         if (self)         {             dashboardviewcontroller = parentcontroller;         }         return self;     }       -(void)loadview     {         // basic size started... final size set later in method.  believe actual height 220         cgrect thegridrectangle = cgrectmake(0, 0, 375, 220);         thegridviewcontrol = [[iggridview alloc]initwithframe:thegridrectangle style:iggridviewstylesinglecellpaging];          // set additional properties configure grid view         thegridviewcontrol.autoresizingmask = uiviewautoresizingflexibleheight | uiviewautoresizingflexiblewidth;         thegridviewcontrol.selectiontype = iggridviewselectiontypecell;         thegridviewcontrol.contentmode = uiviewcontentmodescaleaspectfit;         thegridviewcontrol.allowhorizontalbounce = no;         thegridviewcontrol.alwaysbouncevertical = no;          self.view = thegridviewcontrol;     }       -(void)viewdidload     {         [super viewdidload];          imageeditornavcontroller = [[uinavigationcontroller alloc] init];             }         -(void)presentimageviewerforcellatpath:(igcellpath*)path     {         irpimageandmedia *imageandmediaitem = [thepropertyimageset objectatindex:path.columnindex];          imageviewervc = [[irpimageviewerviewcontroller alloc] initwithparentviewcontroller:self imageset:thepropertyimageset initialimageandmedia:imageandmediaitem];         imageviewervc.edgesforextendedlayout = uirectedgenone;         imageviewervc.navigationitem.title =  dashboardviewcontroller.parcelnbr;         imageviewervc.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action:@selector(imageeditordone)];          // create navigation controller embed image viewer view controller inside.          [imageeditornavcontroller pushviewcontroller:imageviewervc animated:yes];          [self presentviewcontroller:imageeditornavcontroller animated:yes completion:^(void)             {             }];      }      -(void)imageeditordone     {         [self dismissviewcontrolleranimated:yes completion:^{}];     }  } 

...

@implementation irpimageviewerviewcontroller {     iggridview *themainimagegridviewcontrol;     irpimageset *thepropertyimageset;     irpimagefilmstripviewcontroller *thefilmstripviewcontroller;     irpimageandmedia *initialmediaitem;     uiimageview *primaryimagemarker;     irpimageeditorviewcontroller *imageeditorvc;     uiviewcontroller *theparentviewcontroller;  }       -(id)initwithparentviewcontroller:(uiviewcontroller*)parentviewcontroller imageset:(irpimageset*)imageset initialimageandmedia:(irpimageandmedia*)imageandmedia         {             self = [super initwithnibname:@"irpimageviewerviewcontroller" bundle:nil];             if (self)             {                 theparentviewcontroller = parentviewcontroller;                 thefilmstripviewcontroller = [[irpimagefilmstripviewcontroller alloc] initwithparentviewcontroller:self imageset:imageset initialimageandmedia:imageandmedia];                 initialmediaitem = imageandmedia;                 thepropertyimageset = imageset;             }             return self;         }       -(void)viewdidload         {             [super viewdidload];              themainimagegridviewcontrol = [[iggridview alloc]initwithframe:self.mainimageplaceholderview.frame style:iggridviewstylesinglecellpaging];                         // set additional properties configure grid view             themainimagegridviewcontrol.autoresizingmask = uiviewautoresizingflexibleheight | uiviewautoresizingflexiblewidth;             themainimagegridviewcontrol.selectiontype = iggridviewselectiontypecell;             themainimagegridviewcontrol.contentinset = uiedgeinsetszero;             themainimagegridviewcontrol.allowhorizontalbounce = no;             themainimagegridviewcontrol.alwaysbouncehorizontal = no;             themainimagegridviewcontrol.alwaysbouncevertical = no;              [self.mainimageplaceholderview addsubview:themainimagegridviewcontrol];              [self addachildviewcontroller:thefilmstripviewcontroller toviewwithtag:self.filmstripplaceholderview.tag];         }       -(void)addgesturerecognizerstocell:(iggridviewimagecell*)cell         {             static nsmutablearray *recognizers;             uitapgesturerecognizer *doubletaprecognizer;             uilongpressgesturerecognizer *longpressrecognizer;              if (!recognizers)             {                 recognizers = [[nsmutablearray alloc] init];                  doubletaprecognizer = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(handledoubletaprecognizer:)];                 doubletaprecognizer.numberoftapsrequired = 2;                  longpressrecognizer = [[uilongpressgesturerecognizer alloc] initwithtarget:self action:@selector(handlelongpressrecognizer:)];                  [recognizers addobject:doubletaprecognizer];                 [recognizers addobject:longpressrecognizer];             }              // don't because processed.             [cell removegesturerecognizer:doubletaprecognizer];             [cell removegesturerecognizer:longpressrecognizer];             [cell registergestures:recognizers];          }        -(void)handledoubletaprecognizer:(uitapgesturerecognizer*)recognizer         {             nslog(@"double tapped on imageviewerviewcontroller's main image, opening editor");              igcellpath *pathforcurrentcell = [self pathforcurrentcell];             irpimageandmedia *imageandmediaitem = [thepropertyimageset objectatindex:pathforcurrentcell.columnindex];              imageeditorvc = [[irpimageeditorviewcontroller alloc] initwithimageandmediaitem:imageandmediaitem];             imageeditorvc.navigationitem.title = @"photo details editor";             imageeditorvc.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action:@selector(imageeditordone)];             imageeditorvc.edgesforextendedlayout = uirectedgenone;               [self.navigationcontroller pushviewcontroller:imageeditorvc animated:yes];         }       -(void)imageeditordone         {             [self.navigationcontroller poptorootviewcontrolleranimated:yes];         }       -(void)imageeditorcancelled         {             [self dismissviewcontrolleranimated:yes completion:nil];         } } 

... class below 1 keeps being added navigation controller, never appears. ...

@implementation irpimageeditorviewcontroller  {     __weak iboutlet uiswitch *primaryswitch;     __weak iboutlet uiswitch *posttowebswitch;     __weak iboutlet uitextview *descriptionview;     __weak iboutlet uiimageview *imageview;     __weak iboutlet uitextfield *mediadate;     __weak iboutlet uitextfield *ordernbr;     __weak iboutlet uitextfield *updatedby;     __weak iboutlet uitextfield *updatedate;      irpimageandmedia *theimageandmediaitem; }        -(id)initwithimageandmediaitem:(irpimageandmedia*)imageandmediaitem     {         if (self = [super initwithnibname:@"irpimageeditorviewcontroller" bundle:nil])         {             theimageandmediaitem = imageandmediaitem;         }         return self;     }        -(void)viewdidload     {         [super viewdidload];         // additional setup after loading view nib.          [self populateuserinterface];     }        -(void)populateuserinterface     {         imageview.image = [theimageandmediaitem pictureforviewofsize:imageview.bounds.size];          primaryswitch.on = [theimageandmediaitem isprimary];         posttowebswitch.on = [[theimageandmediaitem.mediamanagedobj valueforkey:@"posttoweb"] boolvalue];         descriptionview.text = [theimageandmediaitem.mediamanagedobj valueforkey:@"desc"];         updatedby.text = [theimageandmediaitem.mediamanagedobj valueforkey:@"updatedby"];          nsdateformatter *dateformat = [[nsdateformatter alloc] init];         [dateformat setdateformat:@"mm/dd/yyyy"];         [dateformat settimezone:[nstimezone localtimezone]];         nsstring *theformatteddate = [dateformat stringfromdate:[theimageandmediaitem.mediamanagedobj valueforkey:@"updatedate"]];         updatedate.text = theformatteddate;          ordernbr.text = [[theimageandmediaitem.mediamanagedobj valueforkey:@"order"] stringvalue];      }        -(ibaction)posttowebvaluechanged:(id)sender     {         uiswitch *theswitch = sender;         [theimageandmediaitem.mediamanagedobj setvalue:[nsnumber numberwithbool:theswitch.on] forkey:@"posttoweb"];     }         -(ibaction)primaryvaluechanged:(id)sender     {         uiswitch *theswitch = sender;         [theimageandmediaitem.mediamanagedobj setvalue:[nsnumber numberwithbool:theswitch.on] forkey:@"primary"];      } 

...

enter image description here

-(void)handledoubletaprecognizer:(uitapgesturerecognizer*)recognizer     {         nslog(@"double tapped on imageviewerviewcontroller's main image, opening editor");          igcellpath *pathforcurrentcell = [self pathforcurrentcell];         irpimageandmedia *imageandmediaitem = [thepropertyimageset objectatindex:pathforcurrentcell.columnindex];          imageeditorvc = [[irpimageeditorviewcontroller alloc] initwithimageandmediaitem:imageandmediaitem];         imageeditorvc.navigationitem.title = @"photo details editor";         imageeditorvc.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action:@selector(imageeditordone)];         imageeditorvc.edgesforextendedlayout = uirectedgenone;           [self.navigationcontroller pushviewcontroller:imageeditorvc animated:yes];      } 


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -