Sheehan Alam Sheehan Alam - 6 months ago 23
Objective-C Question

How can I set the titlebar title for a modal view controller?

self.title = @"My View";

Doesn't work when my view is presented modally.


You must write following code for presenting modalView Controller..

yourModelController =[[Yourmodelcontroller alloc]init];

UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController: yourModelController];

[[self navigationController] presentModalViewController:controller animated:YES];
[controller release];

Then in the viewDidLoad-method u need to write

self.title =@"My View";

It will work definitely. Hope it will help you.