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:34 PM   #1 (permalink)
emansfield
New Member
 
Join Date: May 2009
Location: Fredericton, New Brunswick, Canada
Posts: 21
Default modal UIViewController title not showing

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) viewWillAppear:(BOOL)animated {
self.title = (category ? category.name : @"Add New Category");
}

I have also tried:

- (void) viewWillAppear:(BOOL)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.
emansfield is offline   Reply With Quote
 

» Advertisements
» Online Users: 644
16 members and 628 guests
aijo, alphy, apatsufas, ckgni, Dani77, devangvyas, Domele, drewrico, handmachine, hiddendemo, JamesCahall, mistergreen2011, Monstertaco, Oral B, rimap123, rrlemoine
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,787
Threads: 89,205
Posts: 380,601
Top Poster: BrianSlick (7,129)
Welcome to our newest member, rimap123
Powered by vBadvanced CMPS v3.1.0

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