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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:38:56+00:00 2026-06-01T21:38:56+00:00

I have two controller class named TEnterCorrectCodeController and TEmergencyCancelController. In Both the classes there

  • 0

I have two controller class named TEnterCorrectCodeController and TEmergencyCancelController.

In Both the classes there are buttons.On the button click of both controller class I am calling another controller class name TSendEmailController. But problem is when the button click of TEnterCodecontroller is called it opens TSendEmailController through [self presentModalController] and on the click of button present in TsendEmail class I want another class to be opened.

When the button of TEmergencyCancelController is clicked it opens TsendEmail through [self presentModalController] and when the button of TsendEmail is clicked it should not open other class instead it should dismiss controller. The problem is how to identify which class has called TsendEmailController and depending on that I have to check the condition .problem is that I am not using navigationcontroller I am using [self presentModalViewController animated:YES] to push view.

This is my code:

for (int  i=0; i< [self.navigationController viewControllers count]; i++) 
            {
                UIViewController *aController = [[self.navigationController view viewControllers]objectAtIndex:i];
                if ([aController isKindOfClass:[TEnterCorrectCodeController class]])
                {

                    lblAttempt.hidden = YES;
                    [self saveregisteridinplist];
                    TInstructionsController  *instructions = [[TInstructionsController alloc]init];
                    [self presentModalViewController:instructions animated:YES];
                    [instructions release];


                }
                else if ([aController isKindOfClass:[TEmergencyCancelController class]])
                {
                    lblAttempt.hidden = YES;
                    [self saveregisteridinplist];
                    [self dismissModalViewControllerAnimated:YES];


                }
            }

In my code that I have written it does not get into for loop because I am not using navigationController.

  • 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-01T21:38:57+00:00Added an answer on June 1, 2026 at 9:38 pm

    For your solution of identifying which class has called TsendEmail, define one NSIntegerin AppDelegate.
    For ex. NSInteger flag=0;…@property and @synthesize it…..
    Now, when you call TSendEmailfrom TEnterCorrectCodeController, then set flagto 1……and in viewDidLoad of viewWillAppearmethod, set flag to 0….
    Now, when you are in TEmergencyCancelControllerclass, check whether flag is 0 or 1…if 0 then dissmiss your view…..

    You may use this concept….:)

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

Sidebar

Related Questions

I have two action methods in my controller class both with same name. One
I have a NIB with two NSWindow objects. The controller class has two IBOutlets,
If I have a Spring Controller with two SEPARATE methods, one annotated by: @ExceptionHandler(Exception.class)
I have two view controller classes in my application delegate. I can change from
I have two test classes called TT_Common and TT_Container which extends CPPUNIT_NS::TestFixture: class TT_Common
I have two model classes: Cars and Customers , Model Cars : class car
I have two classes: public class Person { public string FirstName { get {
I have two PHP model classes named Category and Item. A Category may have
I have two Controller unit tests and each one sets an HttpClient metaclass execute
I have two actions in my controller : def find @item = Item.find(params[:id]) render

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.