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

  • SEARCH
  • Home
  • 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 6158399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:57:04+00:00 2026-05-23T20:57:04+00:00

stuck at this, seeking advice. What i did and my Project: i make a

  • 0

stuck at this, seeking advice.

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.

My Code in AppDelegate:

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");
}

Here my ViewController1:

- (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];
}

My Console says works0 works1 works2.
Any idea?

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-23T20:57:06+00:00Added an answer on May 23, 2026 at 8:57 pm

    Dont allocate the application delegate
    you need to deal with it like this

    AppDelegate *next =(AppDelegate *) [[UIApplication sharedApplication] delegate];
    [next goToNextPage];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project and I'm stuck with this problem: I have a
Im stuck with this little project in C# but basically my problem is this:
I have been stuck on this for a while now and I cannot seem
I've been stuck with this for a while and cannot make progress. The question
I have been stuck on this one for a while, I'm not an expert
I have been stuck on this problem for days and am about the crack...
I have been stuck on this problem for many hours, but I have a
I've come a bit stuck this afternoon with a bug in my web application
Been stuck on this for ages. Currently learning Django and done some bits on
I am stuck with this issue for a long time. I searched for this

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.