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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:52:46+00:00 2026-05-27T12:52:46+00:00

Hello i have a very simple question, I have initialized some variables and started

  • 0

Hello i have a very simple question, I have initialized some variables and started the motion manager updates on the “viewDidLoad” method, but after i finish using it I am closing the window and returning to the previews one. My question is whether the method is being called everytime i open that window trough a segue in the storyboard. (Since the description says it does it when it loads it to memory not to the screen)

I am closing the window by telling that window that the previous one is its delegate like this:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"Drawing"])
    {
        DrawingViewController *temp = segue.destinationViewController;
        temp.delegate = self;
    }

} 

and then when the user clicks the closing button in the new window it tells the delegate (the previous screen) to close him:

- (IBAction)cancel:(id)sender
{
    [self.delegate DrawingViewControllerDidCancel:self];
}

This is the closing method:

- (void)DrawingViewControllerDidCancel: (DrawingViewController *)controller
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

Oh and if someone would be so kind to tell me why is it that by calling self i am closing the other window, (Because i think self refers to the delegate not to the one that i want to close).

Thank you very much!

  • 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-27T12:52:47+00:00Added an answer on May 27, 2026 at 12:52 pm

    Put some log statements in the viewDidLoad method, this will be easy enough to find out for yourself. You can’t expect a view controller that has been dismissed to be hanging around in memory – it could get unloaded at any time due to a low memory situation. You’ve even called it temp 😉

    dismissModalViewController is passed along the view controller chain, you can call it on the modal controller itself or the presenting controller, it has the same effect. The currently presented modal view controller is dismissed.

    From the documentation:

    If you present several modal view controllers in succession, and thus build a stack of modal view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.

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

Sidebar

Related Questions

Hello I have a very simple question, how do we query by field name??
Original Question: Hello, I am creating very simple hobby project - browser based multiplayer
My question may sound naive, but really struggling to do a very simple thing.
I realize this may be a very simple question but I need to know
This might seem like a very simple question, but I am struggling with it.
I have a very simple question: How can I make this code more simple
I have finally created a very simple Hello World style PHP Extension dll on
Hello I have a very large SQL script and while trying to execute it
Hello I have use DOMDocs in the past but I am stuck how to
I have a very simple C++ code sample here: char *s = new char[100];

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.