Demo function: ios NSTimer application demo. Iphone6.1 passed the test.
Demo Description: The time timer NSTimer in ios is used to complete the scheduled function of the program. He needs three main parameters: the time interval NSTimeInterval floating point type, event proxy delegate and event processing method @ selector (); in this example, nstate is used to cancel a program pop-up dialog box.
Demo screenshot:
Demo main code:
<STRONG xmlns = "http://www.w3.org/1999/xhtml">-(void) handle mdismiss: (NSTimer *) timer {// the processing method of the timer call to hide the prompt box [baseAlert dismissWithClickedButtonIndex: 0 animated: NO]; [baseAlert release]; baseAlert = NULL;}-(void) presentSheet {// defines the prompt Box Information baseAlert = [[UIAlertView alloc] initWithTitle: @ "Alert" message: @ "\ nMessage to user with asynchronous information" delegate: self cancelButtonTitle: nil otherButtonTitles: nil]; // initialize a timer. The three main parameters are interval NSTimeInterval floating point type, event proxy delegate and event handling method @ selector () [NSTimer scheduledTimerWithTimeInterval: 3.0f target: self selector: @ selector (effecmdismiss :) userInfo: nil repeats: NO]; // display the prompt box [baseAlert show] ;}</STRONG>