ios - UIAlertController from Inside the AppDelegate -


i trying present uialertcontroller inside appdelegate , getting sort of errors:

i have @import uikit; @ top.

what doing wrong?

update: here code:

  switch (accountstatus)     case ckaccountstatuscouldnotdetermine:     case ckaccountstatusnoaccount:     case ckaccountstatusrestricted:          uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:@"my alert" message:@"this alert." preferredstyle:uialertcontrollerstylealert];          break; 

if remove uialertcontroller line fine! error says parse issue, expected expression. thats it

you can not create local variable in switch statement without introducing new scope. logical oring enumeration values not want - can instead have cases fall through.

switch (accountstatus) {    case ckaccountstatuscouldnotdetermine:   case ckaccountstatuscouldnoaccount:   case ckaccountstatuscouldrestricted: {     uialertcontroller *controller =        [uialertcontroller alertcontrollerwithtitle:@"my alert"                                           message:@"this alert."                                    preferredstyle:uialertcontrollerstylealert];   } break;  } 

you'll need have kind of context present viewcontroller code listing not show enough provide further code


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -