Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-18-2010, 10:11 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 4
Question help need for popToViewController

I got code as follow, but the popToViewController not working, I'm looping throught the ViewControllers list keep inside the navigationController, and base on the log, it show the correct ViewController found, but when i call the popToViewController, it just crash and show something like
"GNU gdb 6.3.50-20050815 (Apple version gdb-967) (xxxxx (date time)) Copyright 2004 etc etc"

Anybody got any idea about this? Really appreciate for any help!!! Thanks!!

Here is the sample code:
in View u1:
-(id)init {
return self = [super iniwithNibName: @"u1" bundle:nil];
}
-(IBAction)buttonGoU2: (id)sender {
UIViewController *u2 = [[UIViewController alloc] init];
[self navigationcontroller] pushViewController:u2];
[u2 release];
}

in View u2:
-(id)init {
return self = [super iniwithNibName: @"u2" bundle:nil];
}
-(IBAction)buttonGoU3: (id)sender {
UIViewController *u3 = [[UIViewController alloc] init];
[self navigationcontroller] pushViewController:u3];
[u3 release];
}

in View u3:
-(id)init {
return self = [super iniwithNibName: @"u3" bundle:nil];
}
-(IBAction)buttonBack: (id)sender {
NSArray *vList = [[self navigationController] viewControllers];
UIViewController *view;
for (int i=[vList count]-1; i>=0; --i) {
view = [vList objectAtIndex:i];
if ([view.nibName isEqualToString: @"u1"])
break;
}
[[self navigationController] popToViewController:view animated:YES];
[view release];
}

Last edited by applelim08; 01-18-2010 at 10:14 PM.
applelim08 is offline   Reply With Quote
Reply

Bookmarks

Tags
poptoviewcontroller, uinavigationcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 332
21 members and 311 guests
@sandris, ADY, BrianSlick, dacapo, Dani77, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, themathminister, timle8n1, tomtom100, vogueestylee, vvenkatachallam
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,883
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, vvenkatachallam
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:09 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0