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 6124697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:09:44+00:00 2026-05-23T16:09:44+00:00

working on an app and using the following code: – (void)viewDidLoad { [super viewDidLoad];

  • 0

working on an app and using the following code:

- (void)viewDidLoad {
    [super viewDidLoad];

    dataSource = [[NSArray alloc] initWithContentsOfFile:[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"stories.plist"]];

    contentsHeaderImageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ContentsHeader.png"]] autorelease];
    [contentsHeaderImageView setFrame:CGRectMake(0, 0, 320, 131)];
    [contentsHeaderImageView setUserInteractionEnabled:YES];
    [self.view addSubview:contentsHeaderImageView];

    UITableView *tableView = [[[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(contentsHeaderImageView.frame), self.view.frame.size.width, self.view.frame.size.height - CGRectGetMaxY(contentsHeaderImageView.frame))] autorelease];
    [tableView setDelegate:self];
    [tableView setDataSource:self];
    [tableView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
    [tableView setContentInset:UIEdgeInsetsMake(1, 0, 1, 0)];
    [tableView setSeparatorColor:[UIColor whiteColor]];

    [self.view addSubview:tableView];

    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]];
    [tableView setBackgroundColor:[UIColor clearColor]];


    UIImageView *newView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fade.png"]] autorelease];
    [newView setFrame:CGRectMake(0, -20, 320, 69)];
    [self.view addSubview:newView];


    splashImage = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]] autorelease];
    [splashImage setFrame:CGRectMake(0, -20, 320, 480)];
    [self.view addSubview:splashImage];

    [self performSelector:@selector(animateOutSplashImage:) withObject:splashImage afterDelay:3];

}

-(void)drawBookmarkButton
{
    if (self.bookmarkButton) {
        [self.bookmarkButton removeFromSuperview];
    }
    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"bookmark"]) {
        self.bookmarkButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.bookmarkButton setImage:[UIImage imageNamed:@"bookmark 1.png"] forState:UIControlStateNormal];
        [contentsHeaderImageView addSubview:self.bookmarkButton];
        [self.bookmarkButton addTarget:self action:@selector(bookmarkButtonTapped) forControlEvents:UIControlEventTouchUpInside];
        [self.bookmarkButton setFrame:CGRectMake(260, 0, 50, 35)];


        //UITapGestureRecognizer *gr = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bookmarkButtonTapped)] autorelease];
        //[self.bookmarkButton addGestureRecognizer:gr];
    }
}

-(void)animateOutSplashImage:(UIImageView *)splashImg
{
    [UIView animateWithDuration:1 animations:^{
        [splashImage setAlpha:0];

    }completion:^(BOOL finished){
        [splashImage removeFromSuperview];
        splashImage = nil;
        //[self drawBookmarkButton];
    }];

}

-(void)viewWillAppear:(BOOL)animated
{
    [self drawBookmarkButton];
}

For some reason the first time the app is run the bookmark button won’t respond to taps, but if I push a view controller then go back it’s working fine. Spent a while trying to figure this out and nothing is working.

Any ideas???

Thanks!

  • 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-23T16:09:45+00:00Added an answer on May 23, 2026 at 4:09 pm

    Apologies, it was (as usual with me!) a stupid mistake!

    In the delegate I set:

    self.navigationController.navigationBar.backgroundColor = [UIColor clearColor];
    self.navigationController.navigationBar.translucent = YES;
    

    and must have forgot about it. Setting the nav bar to hidden instead meant that the nav bar wasn’t blocking the button.

    Thanks for your help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an iOS app and I'm using the following code for one
I am working on a mvc3.0 app using EF code first and mvc scaffolding.
i'm trying to get multi tenancy working in my app - using nhibernate integration
Im working on an iphone web app using JQTouch , im just wondering what
I'm working on a Silverlight app using the MVVM pattern. My ViewModel currently consists
I am working on a web app using C# and asp.net I have been
I am currently working on a web app using Wicket and started using jQuery
I am working on a simple budget app using Sinatra and DataMapper in Ruby.
I am working on an iPhone mobile web app using jqtouch to make it
I'm working on a cocoa-touch app using OpenAL, but I'm willing to switch to

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.