UIImageView * XXX = [[UIImageView alloc] initWithImage: XXX] - PullRequest
0 голосов
/ 08 мая 2011

Что делает эта строка кода:

UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];

если это поможет Тогда у меня есть это:

int startX2 = round(random() % 480);
// set the flake start position
flakeView.frame = CGRectMake(startX2, 330.0, 30,  20);
flakeView.alpha = 1;

// put the flake in our main view
[self.view addSubview:flakeView];

1 Ответ

1 голос
/ 08 мая 2011

Линия:

UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];

создает контейнер "UIImageView" объект, содержащий изображение "UIImage", хранящееся в ivar flakeImage

Остальные позиции кода flakeView на главном экране с назначенными свойствами x, y, width и hight.

...