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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:24:07+00:00 2026-06-08T05:24:07+00:00

I want to use my own controller for navigating in between uiviewcontrollers. So like

  • 0

I want to use my own controller for navigating in between uiviewcontrollers. So like that I can have custom transitions in between my views.

I did something which is working but I’m not sure if it is the right way? Could there be problems related to memory later?…I’m not sure everything is deallocated the right way.

Thanks for your help!

Here is my code:

In my AppDelegate, when it starts:

self.rootVC = [[[MenuView alloc] initWithNibName:@"MenuView" bundle:nil] autorelease];
[self.window addSubview:self.rootVC.view];

In my AppDelegate, the method for switching in between UIViewController:

-(void) changeRootController: (NSString*) ctrlName{

    UIViewController *oldVC = self.curVC;
    UIViewController *newVC;

    if(ctrlName == @"Studio"){
        newVC = [[StudioView alloc] initWithNibName:@"StudioView" bundle:nil];
    }
    else if(ctrlName == @"Menu"){
        newVC = [[MenuView alloc] initWithNibName:@"MenuView" bundle:nil];
    }

    self.curVC = newVC;

    [UIView transitionWithView:self.window
            duration:1.0
            options:UIViewAnimationOptionCurveEaseIn
            animations:^{
                newVC.view.transform = CGAffineTransformConcat(newVC.view.transform, CGAffineTransformMakeTranslation(-1024, 0));
                [self.rootVC.view addSubview:newVC.view];
                newVC.view.transform = CGAffineTransformConcat(newVC.view.transform, CGAffineTransformMakeTranslation(1024, 0));
                oldVC.view.transform = CGAffineTransformConcat(oldVC.view.transform, CGAffineTransformMakeTranslation(1024, 0));
            } 
            completion:^(BOOL finished){
                if(finished){
                    [oldVC release];
                }
            }
     ];
}

And I switch views in my UIViewController as follow:

AppDelegate *ad = (AppDelegate*)[[UIApplication sharedApplication] delegate];
[ad changeRootController:@"Studio"];
  • 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-06-08T05:24:08+00:00Added an answer on June 8, 2026 at 5:24 am

    newVC isn’t released.

    The block should retain the newVc so after your transitionWithView
    you should call. (last line of function)

    [newVC autorelease];
    

    Thats assuming that the self.curVC property is strong OR retained

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

Sidebar

Related Questions

i want to use my own keyboard class with textfield. how can i use
I want to use two different Spring web contexts , each have own contextConfig,
I have some html files with their own css. I want to use them
I want to use custom delegate in my search tab. I have never used
I have created an editable UITableView that supports several custom UITableViewCells of my own
I want to use my own existing model in GWT application. From what I've
I want to use my own image of arrow for items in listview. Where
I want to use the Restore last session function in firefox, on my own
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I'm trying to implement a navigation controller with some hierarchical views. I want 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.