0
サブビューUIButtonを介して特定の機能の外部に存在しないUIViewをリリースする方法があるのだろうかと思います。私はIBActionにUIViewのトラフにポインタのパラメータを与えることができないので、私は立ち往生しています。UIButtonの/の親UIViewをパラメータで解放するにはどうすればよいですか?
- (IBAction)statsTemp1:(id)sender{
CGRect newSize = CGRectMake(0,13,322,434);
UIView *overl = [[UIView alloc] initWithFrame:newSize];
[self.view addSubview:overl];
[overl setBackgroundColor:[UIColor grayColor]];
[overl setAlpha:0.85];
[self doTheGraphIn:overl];
CGRect btnFrame = CGRectMake(150, 400, 30, 30);
UIButton *closeStatButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
closeStatButton.frame = btnFrame;
[overl addSubview:closeStatButton];
[closeStatButton addTarget:self action:@selector(closeStat:) forControlEvents:UIControlEventTouchUpInside];}-(IBAction)closeStat:(id)sender{
[self release];
}
-(IBAction)closeStat:(id)sender{
[overl release];
}
だけclaryfyする:私はボタンで(UIViewの*)overlをリリースしたいと事前にそれを作成することはできません。あなたの助けのための
おかげで、私はそれをapreciateだろう:)
(そうご確認下さい、メモリから)...これを試してみてください。どうもありがとうございました!考えていないでしょう。 #:UIView * overl = [self.view viewWithTag:99]; [overl removeFromSuperview]; – dos
まあ、あなたも私に投票を与えている可能性があります;) – Jordan