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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:11:01+00:00 2026-06-12T03:11:01+00:00

I hooked into the presented view controller’s init, loadView, viewDidLoad, viewWillAppear:, viewDidAppear:, viewDidUnload and

  • 0

I hooked into the presented view controller’s init, loadView, viewDidLoad, viewWillAppear:, viewDidAppear:, viewDidUnload and dealloc method to log out relevant timing info.

But it was found that whether presentModalViewController:animated: or presentViewController:animated:completion: will result in two instance of the presented view controller and one of them will soonly be destroyed without anything appeared on screen(loadView and next method hasn’t been fired yet).

Is it a bug or iOS’ view controller transition just works like this?

Here is the log info, WDIMMindItemEditViewController is the presented view controller and WDIMMainScreenViewController is the presenting view controller:

2012-09-29 16:10:02.615 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing view controller will initialize

2012-09-29 16:10:02.639 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing view controller initialized

2012-09-29 16:10:02.641 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b94d0> :editing view controller will initialize

2012-09-29 16:10:02.645 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b94d0> :editing view controller initialized

2012-09-29 16:10:02.835 ideaCal[23450:707] < WDIMMainScreenViewController: 0x27c790> will present modal view controller: < WDIMMindItemEditViewController: 0x2b5260>

2012-09-29 16:10:02.841 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing view controller load view

2012-09-29 16:10:02.910 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing
view controller has loaded view

2012-09-29 16:10:02.912 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing view controller’s view will appear

2012-09-29 16:10:03.297 ideaCal[23450:707] < WDIMMainScreenViewController: 0x27c790> will present modal view controller: < WDIMMindItemEditViewController: 0x2b94d0>

2012-09-29 16:10:03.302 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b94d0> :editing view controller will dealloc

2012-09-29 16:10:03.340 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b94d0> :editing view controller ended dealloc

2012-09-29 16:10:03.702 ideaCal[23450:707] < WDIMMindItemEditViewController: 0x2b5260> :editing view controller’s view appeared

2012-09-29 16:10:05.434 ideaCal[23450:707] < WDIMMainScreenViewController: 0x27c790> ended present modal view controller: < WDIMMindItemEditViewController: 0x2b5260>

And here is my presenting code:

- (IBAction)slidingMenuGetPressed:(WZUICircularPagingControlViewSlidingMenu *)slidingMenu event:(UIEvent *)event
{
    WDIMEditViewController * editModalViewController = nil;
    if ([slidingMenu.identifier isEqualToString:NEW_MIND_ITEM]) {
        editModalViewController = [[WDIMMindItemEditViewController alloc] init];
    }
    if ([slidingMenu.identifier isEqualToString:NEW_PROJECT]) {
        editModalViewController = [[WDIMMindItemEditViewController alloc] init];
    }
    if ([slidingMenu.identifier isEqualToString:NEW_TAG]) {
        editModalViewController = [[WDIMTagEditViewController alloc] init];
    }

    dispatch_queue_t snapshotQueue = dispatch_queue_create("com.WeZZardDesign.ScreenSnapshotQueue", NULL);
    dispatch_async(snapshotQueue, ^{
        UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
        [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
        UIImage * snapshot = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        dispatch_async(dispatch_get_main_queue(), ^{
            editModalViewController.backgroundImage = snapshot;
            NSManagedObjectContext * workingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
            workingContext.parentContext = self.database.managedObjectContext;

            editModalViewController.preference = self.preference;
            editModalViewController.dataSource = self;
            editModalViewController.delegate = self;
            editModalViewController.workingContext = workingContext;

            NSLog(@"%@ will present modal view controller: %@", self, editModalViewController);
            [self presentViewController:editModalViewController animated:YES completion:^{
                NSLog(@"%@ ended present modal view controller: %@", self, editModalViewController);
            }];
        });
    });
    dispatch_release(snapshotQueue);
}

And I have got nothing changed in presentModalViewController:animated: and presentViewController:animated:completion: method.

  • 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-12T03:11:02+00:00Added an answer on June 12, 2026 at 3:11 am

    From the comments above it has become clear that NEW_MIND_ITEM and NEW_PROJECT are two strings having the same contents. Since isEqualToString compares the contents, not the pointer, two “if” blocks are executed, creating two instances of WDIMMindItemEditViewController. Using different strings should solve the problem.

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

Sidebar

Related Questions

I'm currently stuck on this problem. I've hooked into the method_missing function in a
I have a View that is hooked to a ViewModel. I have a singleton
I have a sample grabber hooked into my directshow graph, based on this example
I'm trying to modify a stored procedure hooked into an ORM tool. I want
Is it Possible hooked git into XAMPP so it can be managed as part
I have injected my DLL into a target application where I've hooked few WINAPI-functions
I'm using XFBML to load a like button into my page and I hooked
I'm new to SproutCore and have hooked my model and view together via the
I want to insert or update, then insert a new log into another table.
I'm trying to enter a 0 into a Textbox hooked into a MaskedEditExtender. My

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.