image1 = [[UIImageView alloc] initWithFrame:CGRectMake(160, 240, 50, 50)];
image1.image = [UIImage imageNamed:@"icon.png"];
image1.alpha = 1.0;
view1 = [[UIView alloc] initWithFrame:CGRectMake(50, 50, 50, 50)];
[view1 addSubview:image1];
[self.view addSubview:view1];
Code:image1 = [[UIImageView alloc] initWithFrame:CGRectMake(160, 240, 50, 50)]; image1.image = [UIImage imageNamed:@"icon.png"]; image1.alpha = 1.0; view1 = [[UIView alloc] initWithFrame:CGRectMake(50, 50, 50, 50)]; [view1 addSubview:image1]; [self.view addSubview:view1];
This is actually on my CMD+V but it's the same thing right? ^^