iOS methods often change, the previous popup box uses Alertview, and now uses the Uialertcontroller
Macro definition of Alertview
#define ShowMessage (__message__) \
Uialertview *alertview_ = [[Uialertview alloc] initwithtitle:@ "hint" \
MESSAGE:__MESSAGE__ \
Delegate:nil \
cancelbuttontitle:@ "OK" \
Otherbuttontitles:nil]; \
[Alertview_ show];
Macro definition of Uialertcontroller
The message in the parameter is the hint, QUVC is the page that you are currently working on, and the Uiviewcontroller is the one that passes the self
#define SHOWMESSAGE1 (MESSAGE,QUVC) \
Uialertcontroller *alertcontroller = [Uialertcontroller alertcontrollerwithtitle:@ "hint" Message:MESSAGE Preferredstyle:uialertcontrollerstylealert]; \
Uialertaction *okaction = [uialertaction actionwithtitle:@ "OK" style:uialertactionstyledefault Handler:nil]; \
[Alertcontroller addaction:okaction]; \
[QUVC Presentviewcontroller:alertcontroller Animated:yes Completion:nil];
Call:
-(void) loadview{ [Super Loadview]; [Self.backscrollview Setbackgroundcolor:[uicolor Redcolor]; ShowMessage1 (@ " Hello uialertcontroller", Self);}
OBJECTIVE-C macros define Uialertcontroller common methods