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

View Single Post
Old 05-19-2009, 01:45 PM   #2 (permalink)
jsd
at this moment
 
Join Date: Mar 2009
Location: San Francisco, CA
Posts: 900
Default

Quote:
Originally Posted by emansfield View Post
Hi,

I have a UIViewController object which is being presented as a modal view, but I am unable to set the view title. I want the title to vary depending on the context. I have tried the following:

- (void) viewWillAppearBOOL)animated {
self.title = (category ? category.name : @"Add New Category");
}

I have also tried:

- (void) viewWillAppearBOOL)animated {
self.navigationController.title = (category ? category.name : @"Add New Category");
}

neither of the above display any title.

If I set a constant title in the NIB file entry for the view controller in Interface Builder then it displays the title, but I need to be able to set it programmatically.

I can set the title for a view using the first example above on a view controller that is pushed onto the navigation controller's stack and that displays correctly, but it won't do it when presenting the view as a modal view.

Can anyone tell me what I need to do, please.
try
Code:
self.navigationItem.title=@"My Title";
jsd is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,794
Threads: 89,205
Posts: 380,606
Top Poster: BrianSlick (7,129)
Welcome to our newest member, adivoget15
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.