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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:17:18+00:00 2026-06-11T23:17:18+00:00

I am trying to modal to a view controller from a UIAlertView. – (IBAction)cancelScripting:(id)sender

  • 0

I am trying to modal to a view controller from a UIAlertView.

- (IBAction)cancelScripting:(id)sender {


UIAlertView *areYouSure = [[UIAlertView alloc]initWithTitle:@"Are You Sure?" message:@"Are you sure you want to quit scripting?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];

[areYouSure show];



}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

if (buttonIndex == 1) {


    CRHViewController *firstView = [[CRHViewController alloc] init];


    [self.navigationController modalViewController:firstView animated:YES];    }
}

In my .h file I have a UINavigatoinDelegate set

@interface CRHScripting : UIViewController     <UITextViewDelegate,UINavigationControllerDelegate>

In storyboard I have my view controller’s identifier set to firstView.

The line

[self.navigationController modalViewController:firstView animated:YES];

is giving me all the trouble. The error says

"No visible @interface for 'UINavigationController' declares the selector     'modalViewController:animated:' 

What does this mean?

Update: Now My View wont’t fully load, but it will show the view controller

Here is my init code:

#import "CRHViewController.h"

@interface CRHViewController ()

@end

@implementation CRHViewController


-(void)updateTimer {

NSDateFormatter *format = [[NSDateFormatter alloc]init];

[format setDateFormat:@"h:mm"];
clockLabel.text = [format stringFromDate:[NSDate date]];

}


- (void)viewDidLoad
{
    [super viewDidLoad];




    // Do any additional setup after loading the view, typically from a nib.

    timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self     selector:@selector(updateTimer) userInfo:nil repeats:YES];

    [homeIconScrollView setScrollEnabled:YES];
    [homeIconScrollView setContentSize:CGSizeMake (150,1100)];

    NSLog(@"Did Load first View"); 

}

- (void)viewDidAppear:(BOOL)animated {



[UIImageView beginAnimations:NULL context:nil];
[UIImageView setAnimationDuration:2];
[scrollNotify setAlpha:0];
[UIImageView commitAnimations];


}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIDeviceOrientationLandscapeRight);
}

@end
  • 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-11T23:17:19+00:00Added an answer on June 11, 2026 at 11:17 pm

    - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion is a UIViewController method not a UINavigationController method. The correct line is:

    [self presentViewController:firstView animated:YES completion:nil];
    

    *Note that - (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated now shows as being deprecated. If you still want to use it:

    [self presentModalViewController:firstView animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to hide the iPad keyboard from a modal view controller but it
I'm trying to present a modal view controller after selecting a contact and it
I am trying to present a modal view controller. I have read the documentation,
I have a modal view controller that is presented from my main view, I
I am trying to return to view from a controller that has both querystring
I'm trying to present modally a UITableViewController from a view controller in my navigation
How can I present a modal view controller from the app delegate's view, the
im trying to push some view from my modal view. Im trying doing the
Im trying to send some info from a modal view to a delgate. But
I am trying to return a different view from my controller. However, although the

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.