我正在使用自定义覆盖 UIView 类
#import "OverLayView.h"
@implementation OverLayView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
self->overLay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1024, 704)];
self->overLay.backgroundColor = [UIColor colorWithWhite:0 alpha:.5];
}
return self;
}
-(void)removeOverLay{
[self->overLay removeFromSuperview];
}
我正在加载点击动作
OverLayView *m_overLay = [[UIView alloc]initWithFrame:
CGRectMake(0,0,1004,768)];
[m_overLay setBackgroundColor:[UIColor colorWithRed:0. green:0.39 blue:0.106 alpha:0.5]];
[self.view addSubview:m_overLay];
CGRect rect = CGRectMake(0, 0, 1024, 704);
secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
[secondViewController.view setFrame:CGRectMake(300, 60, 430, 620)];
[self.view addSubview:secondViewController.view];
我在使用 UIView 类型的表达式初始化覆盖视图 *_strong' 时遇到不兼容的指针类型。
当我加载时,我需要从 secondViewController 调用 removeOVerLay 这将删除已创建的覆盖
任何人都可以建议我如何删除覆盖
@提前致谢