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 05-12-2011, 01:19 PM   #1 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default NavigationController programmatically

Hello (again!)

I have to make a navigation controller programatically.

I do exactly:

create a file (UIViewController)
delete the view
create a window
link the IBOutlet in File's owner like a View
create a UINavigationController
link the window's rootViewController with UINavigationController

In Interface Builder I have this:
[Window]
(rootViewController)---(Navigation Controller)
(View)---(File's Owner)

I make everything in "Interface Builder"

The problem: I have the code:
Code:
- (IBAction)addPlace:(id)sender {
	AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@"AddPlacePart2Controller" bundle:nil];
	[self.navigationController pushViewController:controller animated:YES];	
	[controller release];
}
After press a button and execute this code block, don't happen anything...
No error and no view change...

Someone, please??
gbergamo is offline   Reply With Quote
Old 05-13-2011, 08:38 AM   #2 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default

Quote:
Originally Posted by gbergamo View Post
Hello (again!)

I have to make a navigation controller programatically.

I do exactly:

create a file (UIViewController)
delete the view
create a window
link the IBOutlet in File's owner like a View
create a UINavigationController
link the window's rootViewController with UINavigationController

In Interface Builder I have this:
[Window]
(rootViewController)---(Navigation Controller)
(View)---(File's Owner)

I make everything in "Interface Builder"

The problem: I have the code:
Code:
- (IBAction)addPlace:(id)sender {
	AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@"AddPlacePart2Controller" bundle:nil];
	[self.navigationController pushViewController:controller animated:YES];	
	[controller release];
}
After press a button and execute this code block, don't happen anything...
No error and no view change...

Someone, please??
No one?
gbergamo is offline   Reply With Quote
Old 05-13-2011, 08:41 AM   #3 (permalink)
Registered Member
 
ngaikwad's Avatar
 
Join Date: Feb 2011
Location: Mobile World
Posts: 450
ngaikwad is on a distinguished road
Default

Quote:
Originally Posted by gbergamo View Post
No one?
why Are you not using the already giving the navigation application in xcode
__________________
Thank & Regard
NI3(Not Impossible 3)
ngaikwad is offline   Reply With Quote
Old 05-13-2011, 08:43 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Code:
- (IBAction)addPlace:(id)sender {
        NSLog(@"addPlace-Started");
	AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@"AddPlacePart2Controller" bundle:nil];
	[self.navigationController pushViewController:controller animated:YES];	
	[controller release];
        NSLog(@"self.navigationController:%@",self.navigationController);
}
what you see in console?
__________________
dany_dev is offline   Reply With Quote
Old 05-13-2011, 03:03 PM   #5 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default

Quote:
Originally Posted by dany_dev View Post
Code:
- (IBAction)addPlace:(id)sender {
        NSLog(@"addPlace-Started");
	AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@"AddPlacePart2Controller" bundle:nil];
	[self.navigationController pushViewController:controller animated:YES];	
	[controller release];
        NSLog(@"self.navigationController:%@",self.navigationController);
}
what you see in console?
Code:
2011-05-13 17:01:23.036 Unear[4191:207] addPlace-Started
2011-05-13 17:01:23.039 Unear[4191:207] self.navigationController:(null)
You found my problem! There's no navigationController finded by the code.
But.. how resolve this?

thanks
gbergamo is offline   Reply With Quote
Old 05-13-2011, 03:05 PM   #6 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default

Quote:
Originally Posted by ngaikwad View Post
why Are you not using the already giving the navigation application in xcode
Because, when I open the view addPlace, I open it with a viewController, like another part of app. And this part would be accessed in other place.
gbergamo is offline   Reply With Quote
Old 05-13-2011, 04:30 PM   #7 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

basically you need to put a reference of navigationController somewhere (in a singleton or in appdelegate) so that you can retrieve it and use...
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
navigationcontroller, view

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: 361
6 members and 355 guests
doffing81, dre, iOS.Lover, Kirkout, MikaelBartlett, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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