UIAlertViewController !???!!!! :mad:

Discussion in 'iOS Programming' started by DennisBlah, Mar 5, 2015.

  1. DennisBlah macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #1
    Hi all,

    why am I getting warnings in my console about
    Code:
    <UIView: 0x7f9de124b4a0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f9de124b570>>'s window is not equal to <UIAlertController: 0x7f9de123e1b0>'s view's window!
    Code:
    UIAlertViewController *myAlert = [UIAlertController alertControllerWithTitle: @"Error" message: @"You've entered an invalid port number!\nPlease review your entered information." preferredStyle:UIAlertControllerStyleAlert];
                    UIAlertAction *cancelAction = [UIAlertAction
                                                   actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action")
                                                   style:UIAlertActionStyleCancel
                                                   handler:^(UIAlertAction *action)
                                                   {
                                                       NSLog(@"Cancel action");
                                                   }];
                    [myAlert addAction:cancelAction];
                    [self presentViewController:myAlert animated:YES completion:nil];
    
    Does this has to do with autoLayout or something? How can I fix this? It's really annoying
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    The answer is not in the code you show, which looks normal. It's not related to autoLayout. It's probably related to the other view in the warning message, which is a fullscreen view, not the alertController's views.

    You are probably doing something illegal with segue's or how you're presenting other views or view controllers.

    See this post for some related info

    http://stackoverflow.com/questions/...nsive-after-presentviewcontrolleranimatedcomp
     
  3. DennisBlah thread starter macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #3
    Hi PhoneyDeveloper,

    I'm not doing anything strange with my seque as far as I'm aware.

    Code:
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
        if ([segue.identifier isEqualToString:@"telnetConnection"]) {
            telnetConnectedView *destViewController = segue.destinationViewController;
            destViewController.tHost = connectionHost.text;
            destViewController.tPort = connectionPort.text;
            destViewController.tUser = connectionUsername.text;
            destViewController.tPass = connectionPassword.text;
            destViewController.tEnable = connectionEnable.text;
        }
    }
    
    
    
    
    .....
    
    
      if(error) {
        //alertviewcontroller
      } else {
        [self performSegueWithIdentifier: @"telnetConnection" sender: @""];
      }
    
    Actually even when I'm not getting in the if(error) and I'm going to the new viewCOntroller I'm receiving this warning.
     

Share This Page