为什么用从nsobject派生的类作为delegate,delegate不能接收到alertview的消息
展开全部
完全没有区别,类似的有:String string Boolean boolean
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐于2016-08-17
展开全部
#import "MySubView.h"
2
3 @implementation MySubView
4
5 - (id)initWithFrame:(CGRect)frame
6 {
7 self = [super initWithFrame:frame];
8 if (self) {
9 // Initialization code
10
11 self.backgroundColor = [UIColor darkGrayColor];
12
13 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"testAlert" message:@"TEST" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
14 [alertView show];
15 }
16 return self;
17 }
18
19 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
20 {
21
22 }
23
2
3 @implementation MySubView
4
5 - (id)initWithFrame:(CGRect)frame
6 {
7 self = [super initWithFrame:frame];
8 if (self) {
9 // Initialization code
10
11 self.backgroundColor = [UIColor darkGrayColor];
12
13 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"testAlert" message:@"TEST" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
14 [alertView show];
15 }
16 return self;
17 }
18
19 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
20 {
21
22 }
23
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询