PDA

View Full Version : UINavigationBar question




brat2
Mar 30, 2009, 03:10 AM
Hi all

I am using UINavigationBar and its showButtonsWithLeftTitle method.

Application is working fine but I have a warrning while compiling that UINavigationBar may not respond to this method and so on...

Actually I didn't find such method in UIKit/UINavigationBar.h

So why is it working if there is no such method declared, or what should I import to take this warrning away ?



yayaba
Mar 30, 2009, 03:50 AM
Hi all

I am using UINavigationBar and its showButtonsWithLeftTitle method.

Application is working fine but I have a warrning while compiling that UINavigationBar may not respond to this method and so on...

Actually I didn't find such method in UIKit/UINavigationBar.h

So why is it working if there is no such method declared, or what should I import to take this warrning away ?

Is that method deprecated? You might be missing a parameter or two. Double check the correct version documentation with the version you're compiling for.

brat2
Mar 30, 2009, 07:45 AM
actually I didn't find such method in <UIKit/UINavigationBar.h> header file as I wrote

how can this method be depricated if it works on simulator and on device ?

jnic
Mar 30, 2009, 08:23 AM
If it's not a published API method then don't use it, it's liable to be removed in future and may result in your app being rejected from review.

PhoneyDeveloper
Jul 2, 2009, 04:32 PM
That method is a private method of UINavigationBar. If you use it then your app may not be allowed on the app store.

What are you using it for and can you replace that functionality with public methods?

Edit: Apparently that method was present in v1.x of UIKit but was deprecated in v2.0. You should simply be able to create your UIBarButtonItems and add them to the navbar and set the title of the view controller.