Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6017289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:06:25+00:00 2026-05-23T03:06:25+00:00

This question has been asked many times, but I tried every solution and none

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:06:26+00:00Added an answer on May 23, 2026 at 3:06 am
    Declare previousArticle and nextArticle in header file
    
    - (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];
    
        previousArticle = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRewind
                                                                                         target:self
                                                                                         action:@selector(displayPreviousArticle)];
    
        [previousArticle setStyle:UIBarButtonItemStyleBordered];
        [buttons addObject:previousArticle];
    
    
        UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                                                                target:nil
                                                                                action:nil];
        [buttons addObject:spacer];
        [spacer release];
    
        nextArticle = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward 
                                                                                     target:self
                                                                                     action:@selector(displayNextArticle)];
        [nextArticle setStyle:UIBarButtonItemStyleBordered];
        [buttons addObject:nextArticle];
    
    
        [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;
    }
    
    -(void)displayNextArticle
    {
    if(articleEnd)
    nextArticle.enabled=NO; 
    else
    nextArticle.enabled=YES;    
    
    }
    -(void)dealloc
    {
    [previousArticle release];
    [nextArticle     release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked many times, but my problem is a
This question has been asked many times in many forums but I haven't seen
Maybe this question has been asked many times before, but I never found a
Halo I'm sure this question has been asked many times in the past, but
I'm sure this question has been asked many times, but I can't figure this
I think this is a question that has been asked many times but I
I know this question has been asked before, but I ran into a problem.
I know this question has been asked many times and I've researched it myself
I know that this question has been asked many times before in different guises
I know this question has been asked and answered in several ways, but none

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.