iphone - Back navigation from an alert view button -


i'm having problems navigation previous view controller (in stack of navigation controller) when user taps custom "back" button shown in alert view. i've tried several ways it, haven't been able it. when button tapped, application goes controller popped alert (as if user press "cancelbutton"). hope can understand me sample code:

in viewdidload, pop alert with:

uialertview *alert = [[uialertview alloc]          initwithtitle:@"xxxxxx"         message:@""          delegate:self           cancelbuttontitle:@"ok"         otherbuttontitles:@"back", nil];     [alert show];     [alert release]; 

then, inside code of view controller call next action try navigate back:

- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex{  if (buttonindex == 1) {     [self.navigationcontroller popviewcontrolleranimated:yes]; }} 

the whole code executed , has no debug errors. if haven't explained trouble properly, please tell me , i'll try better! (i'm spanish , english not best). in advance.


i'll try explain better, in order show problem harder resolve...

i have navigation controller, in determinate moment, shows view tab bar. may know there not way implement tab bar controller inside navigation controller, i've used "custom controller" inserts tab bar.

then, view tab bar, (inside have added subviews) want navigate (clicking alert button) view without tab bar, supose previous view in stack of navigation, can see when push button in navigation bar...

i don't know if it's clearer or have confused more... try make diagram of controllers, if want so. help!

trying in separate thread.

- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex{  if (buttonindex == 1) {    [self performselectorinbackground:@selector(newthreadmethod) withobject:nil]; } } -(void)newthreadmethod{      [self performselectoronmainthread:@selector(go) withobject:nil waituntildone:no];  }    -(void)go{        [self.navigationcontroller popviewcontrolleranimated:yes];   } 

but not right way of doing. time being you.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -