This question has been asked many times, but I tried every solution and none of them solved my problem.
Here's the toolbar creation code :
- (id)initWithBlogArticle:(BlogArticle *)theArticle
{
if (self = [super init])
{
CustomToolbar* tools = [[CustomToolbar alloc] initWithFrame:CGRectMake(0, 0, 90, 48.01)];
[tools setTintColor:[UIColor colorWithRed:0.62 green:0.70 blue:0.13 alpha:1.0]];
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:3];
UIBarButtonItem* previousArticle = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRewind
target:self
action:@selector(displayPreviousArticle)];
[previousArticle setStyle:UIBarButtonItemStyleBordered];
[buttons addObject:previousArticle];
[previousArticle release];
UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
[buttons addObject:spacer];
[spacer release];
UIBarButtonItem *nextArticle = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward
target:self
action:@selector(displayNextArticle)];
[nextArticle setStyle:UIBarButtonItemStyleBordered];
[buttons addObject:nextArticle];
[nextArticle release];
[tools setItems:buttons animated:NO];
[buttons release];
[[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithCustomView:tools] autorelease]];
[tools release];
[self setWebView:[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]];
[[self webView] setDelegate:self];
[self loadBlogArticle:theArticle];
[self setView:[self webView]];
}
return self;
}
I've tried to use setEnabled:NO in every possible way and it never works, which is driving me crazy as disabling a button should be so simple...so either this is extremely complicated to do or I'm not understanding something very basic.
Please help, thanks in advance.