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 12-19-2010, 10:41 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Exclamation Help With UINavigationController

Hey Everyone
I'm developing an app and i need some help.

I have a login screen displayed over a UINavigation Controller and i want it to pushTo the next view controller that is under the login screen. the problem is, is that the view under the login view is controlled by another view controller and so therefore self.navigationController pushViewController:newScreen dosent work.

What i have is:
Login.m
Code:
...

-(IBAction) logIn:(id)sender {
			
			[self dismissModalViewControllerAnimated:YES];
			
			//I am Currentaly in Home view and need to push to First view
I have tried doing
Code:
[home.navigationController pushViewController:firstView animated:YES]
but that dosent work

Please Help
malidog96 is offline   Reply With Quote
Old 12-20-2010, 12:10 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

Bump
malidog96 is offline   Reply With Quote
Old 12-20-2010, 12:14 AM   #3 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

There's no need to bump threads after an hour.
baja_yu is offline   Reply With Quote
Old 12-20-2010, 02:09 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
There's no need to bump threads after an hour.
Im new here.
thanks 4 the tip tho.
malidog96 is offline   Reply With Quote
Old 12-20-2010, 03:13 AM   #5 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

you say "the view under the login", there is a view under another? if so, just hide (or removeFromSuperview) navigationController.
__________________
dany_dev is offline   Reply With Quote
Old 12-20-2010, 01:01 PM   #6 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

Yeah, the home view is under the login page(which was called by presentModalViewController)

I want the home view to push to the Next view when i click the login button on the login page.

You can look at the diagram, the login screen has a button and the button causes the home view to push to the Next view before the login dismissModalView happens.

Attached Images
File Type: jpg Diagram.jpg (11.7 KB, 0 views)

Last edited by malidog96; 12-20-2010 at 01:12 PM.
malidog96 is offline   Reply With Quote
Old 12-20-2010, 01:20 PM   #7 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

debug that line, because it is the right way to do it.

[home.navigationController pushViewController:firstView animated:YES]

home.navigationController is your navigation controller? firstView is correctly initialized
__________________
dany_dev is offline   Reply With Quote
Old 12-20-2010, 11:46 PM   #8 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

yes now ive initialized home by doing

Code:
@interface loginViewController{
homeViewController *home;
}
in the login.h file and then done a
Code:
-(IBAction)login{
home = [[homeViewController alloc] init]; [home.navigationController pushViewController:firstView animated:YES];
}
in the login.m file

did i implement home correctly???
malidog96 is offline   Reply With Quote
Old 12-20-2010, 11:50 PM   #9 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Arrow

P.S. - I don't really know how to use the gdb debugger. How would i debug a line??

Best Regards,
Chase
malidog96 is offline   Reply With Quote
Old 12-21-2010, 01:22 AM   #10 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

hey dany88
i made a test file.

i haven't added any text but you can figure it out.

button to access the login view is at the right hand side of the navigation bar

the login screen has a button that dismisses the view and attempts to push the view controller. you can mess around with the test project to try to get it to work for you.

it is attached at the bottom.
Attached Files
File Type: zip test.zip (27.7 KB, 6 views)
malidog96 is offline   Reply With Quote
Old 12-21-2010, 06:06 PM   #11 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

for "debug" i mean to add some breakpoint to see what happen.

However i downloaded the sample, the problem is that you are doing

Code:
	RootViewController *home = [[RootViewController alloc] init];
	FirstView *firstView = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
	[home.navigationController pushViewController:firstView animated:YES];
in other words, you are allocing a new RootViewController and you say "in navigationController of this NEW viewcontroller (and not the viewcontroller that i have already allocated and added to my view), please push FirstView"

what you need is:
Code:
testAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
	
	FirstView *firstView = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
	[appDelegate.navigationController pushViewController:firstView animated:YES];
In this manner, you are accessing at your appDelegate with a singleton method, and then you push on his navigationcontroller your view

ps: don't miss the [firstView release]; for don't leak.
__________________
dany_dev is offline   Reply With Quote
Old 12-22-2010, 08:24 PM   #12 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Boulder,CO
Posts: 13
malidog96 is on a distinguished road
Default

great for the help and the fast replies

your help has been greatly appreciated

Yours Truly
-Chase
malidog96 is offline   Reply With Quote
Reply

Bookmarks

Tags
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: 396
9 members and 387 guests
chemistry, daudrizek, HemiMG, jeroenkeij, Kirkout, PavelMik, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

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