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];
精彩评论