0

I did my coding in xcode-4.2 and after updating xcode-4.5.1,My app running perfectly,while clicking window to navigate it shows following error.

Warning: Attempt to present <learnview: 0x8876220> on <UINavigationController: 0x8866e10> whose view is not in the window hierarchy!

I change the function from viewdidload() to viewdidappear() still its showing the same error?Please help me to solve out

Edited:

    -(void)goright
   {
    CATransition* transition = [CATransition animation];
    transition.duration = 1.5;
   transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
    transition.type = kCATransitionPush;
    learnview *lview=[[learnview alloc]initWithNibName:@"learnview" bundle:nil];
    transition.subtype = kCATransitionFromRight; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
    [self.navigationController.view.layer addAnimation:transition forKey:nil];
   [[self navigationController] pushViewController:lview animated:NO];

    [imagetim invalidate];    
    }     
Fazil
  • 1,390
  • 2
  • 13
  • 26

1 Answers1

0

Call This method in viewWillAppear: or viewDidAppear:

with Animation try below Code...

-(void)goright
{
    CATransition *animation = [CATransition animation];
    [animation setDelegate:self];   
    [animation setType:kCATransitionPush];
    [animation setDuration:1.5];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:
                                  kCAMediaTimingFunctionEaseInEaseOut]];
    [animation setSubtype:kCATransitionFromRight];
    [[self.view layer] addAnimation:animation forKey:@"transitionViewAnimation"];

    learnview *lview=[[learnview alloc]initWithNibName:@"learnview" bundle:nil];
    [[self navigationController] pushViewController:lview animated:NO];

    [imagetim invalidate];    
}

and without Animation try this below code...

-(void)goright
    {

        learnview *lview=[[learnview alloc]initWithNibName:@"learnview" bundle:nil];

        [self.navigationController pushViewController:lview animated:YES];

        [imagetim invalidate];    
    }     

try this

Rayfleck
  • 12,116
  • 8
  • 48
  • 74
Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
  • i think Import your this learnview again in your project bcoz system not find this file from your Tree so just try this.. – Paras Joshi Oct 26 '12 at 07:15