UIView *v =[[UIView alloc] initWithFrame:CGRectMake(10, 20, 320, 30)];
v.tag = 200;
v.backgroundColor = [UIColor blackColor];
[self.window addSubview:v];
[v release];
//>的所有对象权已经交给window
return YES;
}
-(void)click:(UIButton *)b
{
NSLog(@"tag is %d",b.tag);
//在父视图中寻找子视图tag值为N的UIView方法
UIView *v =[self.window viewWithTag:200];
NSLog(@"v is %@",v);
}