iOS Delegate Does Not Push or Present a View -


i have homeview , homedropdownview.

homedropdownview shown drop-down view on homeview.

homeview delegate of homedropdownview.

when action in homedropdownview want call delegate method in homeview , have delegate method present third view controller, testviewcontroller it's navigation controller.

if try launch testviewcontroller anywhere in class works fine - except delegate method.

there animations in homedropdownview putting call delegate method in complition not make view controller appear. , in case i'm using animation's don't fire anyway; there's resizing without animation.

testviewcontroller's init called viewdidload not viewwillappear , view dose not appear.

code:

homedropdownview

- (void)finalaction {     ...     [self calldelegateaction];     ...  - (void)calldelegateaction {     if ([self.delegate respondstoselector:@selector(launchtestview)] ) {         [self.delegate launchtestview];     } else {         dlog(@"error out user.");     } } 

homeview

- (void)launchtestview {         //[self listsubviewsofview:self.parentviewcontroller.view];          nslog(@"delegate method | self: %@", self);          testviewcontroller *tvc = [[testviewcontroller alloc] initwithnibname:@"testviewcontroller" bundle:nil];         //[self.navigationcontroller presentviewcontroller:tvc animated:yes completion:nil];         //[self.view.window.rootviewcontroller presentviewcontroller:tvc animated:yes completion:nil];         //[self.navigationcontroller pushviewcontroller:tvc animated:yes];         appdelegate *appdelegate = (appdelegate *)[[uiapplication sharedapplication] delegate];         [appdelegate.tabbarcontroller.navigationcontroller presentviewcontroller:tvc animated:yes completion:^() {             nslog(@"done!");         }]; } 

none of above approaches work. if put exact same code viewdidappear or put in button action method, work fine. @ time of calling delegate method's self homeview , subviews, including nav controller seem there. in tabcontroller-based project think of above acceptable ways call nav controller still.

what missing? why delegate method not want push/present viewcontroller on homeview's nav controller? it's i'm missing can't find reason in apple docs or other thread. help!

sadly turned out homeview being changed underneath execution of message. time homeview got message call no longer same homeview object had requested action in first place. not same delegate. done appear user same view being used different things. example of why should not destroy , re-create critical views. should have been using same view , reloading objects instead if knew sending messages. or had notion of control structure.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -