Search code examples
objective-cipadios4xcode4

how to make a UIAlertView to hide automatically without User Interaction?


When the focus in a particluar rect of the screen , it need to show up a message and need to hide automatically . Whether alertview will be flexible or any other way is there to implement the stuffs in iPhone and iPad .


Solution

  • You can use timer to close alert after some time, for example:

    [[NSTimer scheduledTimerWithTimeInterval:2 
                                     target:self 
                                     selector:@selector(closeAlert:) 
                                     userInfo:nil 
                                     repeats:NO] retain];
    

    For more information look here: NSTimer Class Reference