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-28-2008, 10:55 PM   #1 (permalink)
New Member
 
Join Date: Dec 2008
Location: San Diego, CA
Posts: 4
ronaldbe is on a distinguished road
Send a message via ICQ to ronaldbe Send a message via AIM to ronaldbe Send a message via MSN to ronaldbe Send a message via Yahoo to ronaldbe
Exclamation Cannot set title on UINavigationController

After Programatically adding a UINavigationController to one of my views, I cannot seem to set the title of it. Here is the code I'm using:

Code:
tableViewController = [[MyTableViewController alloc] initWithStyle:UITableViewStylePlain];
navigationController = [[UINavigationController alloc] initWithRootViewController:tableViewController];
navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
navigationController.navigationItem.title = @"Title";
navigationController.view.frame = CGRectMake(0.0, 0.0, 320.0, 460.0);
[self.view addSubview:navigationController.view];
Can anybody see something I'm doing wrong??
ronaldbe is offline   Reply With Quote
Old 12-28-2008, 11:25 PM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Location: Austin, TX
Posts: 239
ayasin is on a distinguished road
Default

replace this line:
Code:
navigationController.navigationItem.title = @"Title";
with this line:
Code:
tableViewController.title = @"Title";
__________________
iNeedStuff shopping assistant - get in, get out, get on with your life
ayasin is offline   Reply With Quote
Old 12-28-2008, 11:46 PM   #3 (permalink)
New Member
 
Join Date: Dec 2008
Location: San Diego, CA
Posts: 4
ronaldbe is on a distinguished road
Send a message via ICQ to ronaldbe Send a message via AIM to ronaldbe Send a message via MSN to ronaldbe Send a message via Yahoo to ronaldbe
Default

Thanks!! Worked perfectly, so I take it that the Navigation Controller gets it's title from whatever view it's displaying. Didn't know that.
ronaldbe is offline   Reply With Quote
Reply

Bookmarks

Tags
bar, navigation, uinavigationbar, uinavigationcontroller, uiviewcontroller

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: 325
8 members and 317 guests
chemistry, Dnnake, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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