I can draw an image into the navbar by adding this to the bottom of my delegate.m class.
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect
{
UIImage *img = [UIImage imageNamed: @"nav_bar.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
This works great so far, but I would like to have some global BOOL var i can set from all my other viewControllers so I can change the navbar when needs be.
Does anybody know of a good solution? Is there a way to set some global var that all classes can see and that I can reference from with the above method?
Cheers,
-Code
Assuming you have a global bool in your app delegate
You can access your application delegate from any class in your app like this
and set the global bool variable