ViewWithName A catory with UIView, distinguish views by their names UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0,0,20,20)]; [self.view addSubView:view]; [view setname:@"No.1"]; //this must add after addsubview