user1895268 user1895268 - 7 months ago 40
iOS Question

Setting a prompt to UINavigation Bar

I tried to search but I can't find the right answer for me.
I tried to set a PromptText in the navigationBar but it does not work.
No matter where i put this line of Code

self.navigationController.navigationBar.topItem.prompt = @"MyTitle";

It does not work. I put it in the Child and RootViewController. The effect is that the RootView Controller has a prompt but not the ChildViewController.
Can anybody help me, please?


I don't know what you're trying to do exactly. But you shouldn't just change the topItem. Instead, change the view controller's navigation item like this:

self.navigationItem.prompt = @"MyTitle";