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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:36:23+00:00 2026-06-16T20:36:23+00:00

Just a simple question Currently i present a modal view like this: + (void)showModalController:(id)ContentController

  • 0

Just a simple question

Currently i present a modal view like this:

+ (void)showModalController:(id)ContentController InViewController:(UIViewController*)vc withFrame:(CGRect)rect{

UINavigationController *modalViewNavController = [[UINavigationController alloc] initWithRootViewController:ContentController];
modalViewNavController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
modalViewNavController.modalPresentationStyle = UIModalPresentationFormSheet;

[vc presentModalViewController:modalViewNavController animated:YES];

//it's important to do this after presentModalViewController
modalViewNavController.view.superview.frame = rect;

//self.view assumes the base view is doing the launching, if not you might need self.view.superview.center etc.
modalViewNavController.view.superview.center = vc.view.center;

[modalViewNavController release];

}

I pass the values of the UIViewController Content that it will be presented, at a custom modal size. I also pass the values of the UIViewController where the modal it will be presented.

In terms of code, i want to know the “vc” name at the content class, if it’s possible to do so.

EDIT

Lets say i have 2 classes, one is called DetailViewController where the modal will be presented. And the other one is called ModalContentViewController.

I want to know at the ModalContentViewController class (when the view appears, or is loaded) the name of the DetailViewController.

Any ideas?

PD: Currently Using…

XCode 4.4.1
iPad Simulator iOS5.1
iOS5.1

  • 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-16T20:36:24+00:00Added an answer on June 16, 2026 at 8:36 pm

    Look for the UIViewController property presentingViewController. Here’s a quote from the docs:

    If the view controller that received this message is presented by
    another view controller, this property holds the view controller that
    is presenting it. If the view controller is not presented, but one of
    its ancestors is being presented, this property holds the view
    controller presenting the nearest ancestor. If neither the view
    controller nor any of its ancestors are being presented, this property
    holds nil.

    So you could use that property to get the presenting VC’s name.

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

Sidebar

Related Questions

This is just a simple question. I'm currently using Mozilla's Rhino to develop a
This is just a simple question. I was trying to create a new object
This is just a simple question. I've been reading the source of something which
This is just a simple question. Either way works. I prefer my first example,
[see later answer for more] I think this is just a simple rails question,
I'm brand new to Ruby/Rails/RSpec, and hopefully this is a dumb/simple question. I'm currently
Now it seems like a really simple question and I may just be being
First off, I'm sure this is a simple question. I'm just getting started with
This a pretty simple question, I'm just not sure how to do it exactly.
Sorry if this is a simple question, but I just can't figure out what

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.