-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyAlertView.m
More file actions
executable file
·52 lines (41 loc) · 1.12 KB
/
Copy pathmyAlertView.m
File metadata and controls
executable file
·52 lines (41 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// myAlertView.m
//
// Created by Ysan on 13-9-2.
// Copyright (c) 2013年 a. All rights reserved.
//
#import "myAlertView.h"
#import "RDPSession.h"
#import "RDPSessionView.h"
#import "RDPSessionViewController.h"
@interface myAlertView ()
@end
@implementation myAlertView
@synthesize mysession;
- (void)viewDidLoad
{
[super viewDidLoad];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"网速不给力,是否继续接入云端?" delegate:self cancelButtonTitle:@"继续" otherButtonTitles:@"退出", nil];
[alert show];
[self performSelector:@selector(dismissAlert:) withObject:alert afterDelay:7.0];
}
-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
NSLog(@"ok");
[mysession disconnect];
}
else {
NSLog(@"go on...");
}
}
- (void)dismissAlert:(UIAlertView*)alert {
if ( alert.visible ) {
[alert dismissWithClickedButtonIndex:alert.cancelButtonIndex animated:YES];
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end