Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't change viewcontroller from UIAlertView
    primarykey
    data
    text
    <p>I am trying to modal to a view controller from a UIAlertView. </p> <pre><code>- (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]; } } </code></pre> <p>In my .h file I have a UINavigatoinDelegate set</p> <pre><code>@interface CRHScripting : UIViewController &lt;UITextViewDelegate,UINavigationControllerDelegate&gt; </code></pre> <p>In storyboard I have my view controller's identifier set to firstView.</p> <p>The line</p> <pre><code>[self.navigationController modalViewController:firstView animated:YES]; </code></pre> <p>is giving me all the trouble. The error says </p> <pre><code>"No visible @interface for 'UINavigationController' declares the selector 'modalViewController:animated:' </code></pre> <p>What does this mean? </p> <p><strong>Update: Now My View wont't fully load, but it will show the view controller</strong></p> <p>Here is my init code:</p> <pre><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 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload