我有一个绿色矩形,但是当我运行应用程序时它不会显示。这是我的代码:
- (void) makeBlockg {
x = arc4random()%(320) + 1;
CGRect block = CGRectMake(x, 0, 100, 70);
greenblock.frame = block;
greenblock.self.backgroundColor = [UIColor greenColor];
[self.view addSubview:greenblock];
}