开发者

Problem with creation of uiimageView in arrays

开发者 https://www.devze.com 2023-03-23 00:25 出处:网络
here is my code : -(void) createImage { UIImage * image = [UIImage imageNamed:@\"abouffer_03.png\"]; imageView = [[UIImageView alloc] initWithImage:image];

here is my code :

-(void) createImage {


UIImage * image = [UIImage imageNamed:@"abouffer_03.png"];
imageView = [[UIImageView alloc] initWithImage:image];

[imageView setCenter:[self randomPointSquare]];

 [imageViewArray addObject:imageView];

[[self view] addSubview:imageView];

[imageView release];


}

-(void)moveImage{
for(int i=0; i&开发者_如何学JAVAlt; [imageViewArray count];i++){
    UIImageView *imageView = [imageViewArray objectAtIndex:i];
    imageView.center = CGPointMake(imageView.center.x + X, imageView.center.y + Y);
}

I try to use an array in this code but, it doesn't work, indeed I have never used array, and it would be cool if someone could tell me where is my error ;thank you . sorry for my english I'm french :/


You'r missing: imageViewArray = [[NSMutableArray alloc]init];

0

精彩评论

暂无评论...
验证码 换一张
取 消