0

I have an app I am working on, and I am trying to have the logo on for a bit longer, and fade out/slide out/effect when it's done.

Here's my setup: Setup

The Tab Bar controller is not letting me place an Image View inside it, so I created a view to have it on.

I am trying to have the logo stay on for a bit, fade out, then automatically switch the view (Segue) to the Tab Bar controller.

This is what I get out of it: http://youtu.be/l4jL0BfpR2k

So here's my code:

//
//  BDNLogoViewController.m
//  Bronydom Network
//
//  Created by name on 10/1/13.
//  Copyright (c) 2013 name. All rights reserved.
//

#import "BDNLogoViewController.h"
#import "BDNTabBarController.h"
#import "BDNFirstViewController.h"

@interface BDNLogoViewController ()

@end

@implementation BDNLogoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}



- (void)viewDidLoad
{
    [super viewDidLoad];

    // Do any additional setup after loading the view.
    [UIView animateWithDuration:1 animations:^{
        _imageview.alpha = 0;
    }];

    //BDNTabBarController *viewController = [[BDNTabBarController alloc] init];
    //[self.navigationController pushViewController:viewController animated:YES];

    (void)@selector(seguePerform:);

}

- (void)seguePerform:(id)sender
{
    //BDNTabBarController *myNewVC = [[BDNTabBarController alloc] init];

    // do any setup you need for myNewVC

[self performSegueWithIdentifier:@"open" sender:sender];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

Yes, "open" is defined as the segue id.

Do you guys have any ideas on how I could fix this?

x86cam
  • 407
  • 1
  • 5
  • 13

1 Answers1

1

To fix, add this

- (void) viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:YES];
    [self performSegueWithIdentifier:@"open" sender:self];
}

Remove this from your code

(void)@selector(seguePerform:); // and all other unnecessary segue stuff you had

DogCoffee
  • 19,820
  • 10
  • 87
  • 120
  • The first image disappeared because I am animating the Alpha of the image. Oh, I tried to log at the prepareForSegue part, but I never got the message. Have any more ideas? – x86cam Oct 02 '13 at 03:55
  • Apparently the "prepareforSegue" method is not being called or the Segue `[self performSegueWithIdentifier:@"open" sender:sender];` isn't working. – x86cam Oct 02 '13 at 04:03
  • It looks like I have the correct one (Main), I also do have the "open" in the Segue Identifier box. – x86cam Oct 02 '13 at 04:08
  • upload code to dropbox or something and i'll have a look, could also put a log in the viewDidLoad of the destination VC. also have a read of this http://stackoverflow.com/questions/8838160/prepareforsegue-is-not-called-after-performseguewithidentifier-with-popover-st – DogCoffee Oct 02 '13 at 04:20
  • Okay. Source posted: https://www.dropbox.com/s/z9sp5g3x6qtnwsz/Bronydom%20Network.zip – x86cam Oct 02 '13 at 04:28
  • Works for me.. i had to delete the "Tune in.png" reference as it was missing - but works 100%. – DogCoffee Oct 02 '13 at 04:37
  • Try setting the logo view to default. The app loads perfectly with it set to load the Tab Bar controller directly. – x86cam Oct 02 '13 at 04:39
  • Got it to try and segue, and getting this error Bronydom Network[72725:a0b] Warning: Attempt to present on whose view is not in the window hierarchy! – DogCoffee Oct 02 '13 at 04:47
  • after some research found an answer. glad to help – DogCoffee Oct 02 '13 at 06:10