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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 07-04-2010, 02:04 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 8
davism is on a distinguished road
Default Switching Back Views

Hi all,

I have an toolbar app with a home, calendar, and contact info. section. On the calendar's section I have toolbar buttons to switch between months (July, August, September and so on). I am using this code to switch between the different views:

- (IBAction) switchToAugust{

augustMonthly *view3 = [[augustMonthly alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:view3 animated:NO];

}

This works fine for switching views (switching from July To August), but I need a way to get back to the main window toolbar like a "Done" button. I tried this:

- (IBAction) return {

[self.parentViewController dismissModalViewControllerAnimated:YES];
}

Which does indeed go back, but it goes back to the previous view so if I go to August, then press back it will take me to July then August and it never ends. How do I return to the tab bar main window using similar code? When I try the code I first listed with the CalendarViewController.h instead of augustMonthly.h, it simply takes me to a white screen! Thanks for any help

Happy 4th of July!
davism is offline   Reply With Quote
Old 07-06-2010, 08:32 AM   #2 (permalink)
el guaje
 
kevinyide's Avatar
 
Join Date: Jun 2010
Posts: 243
kevinyide is on a distinguished road
Send a message via Yahoo to kevinyide
Default

Quote:
Originally Posted by davism View Post
Hi all,

I have an toolbar app with a home, calendar, and contact info. section. On the calendar's section I have toolbar buttons to switch between months (July, August, September and so on). I am using this code to switch between the different views:

- (IBAction) switchToAugust{

augustMonthly *view3 = [[augustMonthly alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:view3 animated:NO];

}

This works fine for switching views (switching from July To August), but I need a way to get back to the main window toolbar like a "Done" button. I tried this:

- (IBAction) return {

[self.parentViewController dismissModalViewControllerAnimated:YES];
}

Which does indeed go back, but it goes back to the previous view so if I go to August, then press back it will take me to July then August and it never ends. How do I return to the tab bar main window using similar code? When I try the code I first listed with the CalendarViewController.h instead of augustMonthly.h, it simply takes me to a white screen! Thanks for any help

Happy 4th of July!
have you tried
popToRootViewControllerAnimated ??
kevinyide is offline   Reply With Quote
Old 07-11-2010, 02:20 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 8
davism is on a distinguished road
Default

No, how does this work?
davism is offline   Reply With Quote
Old 07-22-2010, 12:56 AM   #4 (permalink)
el guaje
 
kevinyide's Avatar
 
Join Date: Jun 2010
Posts: 243
kevinyide is on a distinguished road
Send a message via Yahoo to kevinyide
Default

Code:
- (IBAction) return {

[self.parentViewController popToRootViewControllerAnimated:NO];
}
kevinyide is offline   Reply With Quote
Reply

Bookmarks

Tags
back, switch, view, xcode

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: 329
6 members and 323 guests
anothermine, Chickenrig, givensur, michaelhansen, PixelInteractive, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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