Reputation: 110380
What additional code do I need to add to make the below work?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
return YES;
}
It is currently throwing the error: Property 'navigationController' not found on object of type 'AppDelegate
.
Upvotes: 0
Views: 1914
Reputation: 11132
Method -application:didFinishLaunchingWithOptions:
belongs to your AppDelegate
's class, and self
inside a method refers to the class that method belongs to. AppDelegate
doesn't have the method navigationController
that's why it complains.
You probably meant to run this code on the root view controller, not on the app delegate. Chance is that you initialized it somewhere in the same method, you just need to replace self
with whatever variable that points to the root view controller:
[root view controller].navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
Upvotes: 4