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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:12:48+00:00 2026-06-17T16:12:48+00:00

MainMenuViewController presents BonusViewController modally. I want to Dismiss BonusViewController then display a new BonusViewController,

  • 0

MainMenuViewController presents BonusViewController modally. I want to Dismiss BonusViewController then display a new BonusViewController, effectively “resetting” BonusViewController.

Im using notifications to call this method in MainMenuViewController

-(void)resetBonus{



    [self dismissViewControllerAnimated:YES completion:nil];

    [self presentViewController: BonusViewController animated:NO completion:nil];


}

I expected BonusViewController to be auto-detected as I was typing it in the presentViewController call above but it was not and none of my viewControllers show up as I type which Im assuming means im doing this all wrong. Do I have to initialize the VC or allocate it before I can present it like this? Or can I even do this at all since im using storyboards?

I also tried this though I believe this method is deprecated

-(void)resetBonus{

    [self dismissModalViewControllerAnimated:YES];
    [self presentModalViewController: BonusViewController animated:NO ]; 

}

enter image description here

Did what Sumanth suggested but I get this message now:

enter image description here

so now I m doing :

#import "BonusViewController.h

....

-(void)resetBonus
{
BonusViewController  *bonus = [[BonusViewController alloc]init];
[self dismissModalViewControllerAnimated:NO];
[self presentModalViewController: bonus animated:NO ];

}

the errors are all gone but when BonusViewController is presented the display is solid black, i can hear the sounds going but cant see anything on the screen

  • 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-17T16:12:49+00:00Added an answer on June 17, 2026 at 4:12 pm

    you should allocate and initialize the viewcontroller and present that using presentModalViewController write like this

    BonusViewController  *bonus = [[BonusViewController alloc]init]; 
    [self dismissModalViewControllerAnimated:YES];
    [self presentModalViewController: bonus animated:NO ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a usual iOS Cocos2d game. I start with a MainMenuViewController, which then
I'm setting a new stack of ViewControllers to my navigationController by doing the following:
I have a navigationController in MainMenuViewController class. When I push FirstViewController in navigationController I
I have MainMenuViewController with button which action is - (IBAction) goToFirstView { FirstViewController *fvc
I may just be passing data between views completely wrong here, so I am
Okay so i decided to move my code for my UITableView delegates into another
I just added a class to my Xcode project and the linker is giving
I have implemented a simple segue from a button click. Here is the view
I'm having a hard time trying to do something simple, I have one viewcontroller
I have a rootviewcontroller and a loginviewcontroller. As soon as my app has finished

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.