Note that there are some explanatory texts on larger screens.

plurals
  1. POswitching ViewController in AppDelegate - doesn´t show up
    primarykey
    data
    text
    <p>stuck at this, seeking advice.</p> <p>What i did and my Project: i make a book for children. Every page is a custom ViewController. On every Page i have a button for next and previous Page. I use the AppDelegate to load the ViewControllers. My AppDelgate starts with the ViewController1 and when i Press the Button/swipe in ViewController1 it should Load the ViewController2 but nothing happens. </p> <p>My Code in AppDelegate: </p> <pre><code>self.view1 = [ViewController1 alloc]; [window addSubview:view1.view]; [window makeKeyAndVisible]; - (void)goToNextPage { view2 = [ViewController2 alloc]; UIView *current = self.window; [self.window addSubview:view2.view]; CATransition *animationT = [CATransition animation]; [animationT setDuration:0.5]; [animationT setType:kCATransitionMoveIn]; [animationT setSubtype:kCATransitionFromRight]; [animationT setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [[current layer] addAnimation:animationT forKey:@"SwitchToView1"]; NSLog(@"works2"); } </code></pre> <p>Here my <strong>ViewController1</strong>:</p> <pre><code>- (void)addButtonNext { UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector (buttonClicked:)] autorelease]; swipeGesture.numberOfTouchesRequired = 1; swipeGesture.direction = (UISwipeGestureRecognizerDirectionLeft); [self.view addGestureRecognizer:swipeGesture]; NSLog(@"works0"); } - (void)buttonClicked:(id)sender { NSLog(@"works1"); AppDelegate* next = [AppDelegate alloc]; [next goToNextPage]; } </code></pre> <p>My Console says <code>works0 works1 works2</code>. Any idea?</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload