J'essaie de faire en sorte que lorsque mes images sont générées à l'écran, elles défilent vers le bas, mais pour une raison quelconque, tous mes astroïdes font apparaître et ne bougent pas ... voici mon code.déplacer une imageview lorsque généré à partir d'un tableau?
astroidArray = [[NSMutableArray alloc] init];
UIImage *astroid = [UIImage imageNamed:@"astroidwhite.png"];
UIImageView *astroids = [[UIImageView alloc] initWithImage:astroid];
//set X and Y of the new imageView
astroids.center = CGPointMake(100 , 100);
astroids.center = CGPointMake(astroids.center.x - astroidVelocity.x , astroids.center.y - astroidVelocity.y);
astroidVelocity = CGPointMake(0,5);
//add to array
[astroidArray addObject:astroids];
//add to the view, so it gets displayed.
[self.view addSubview: astroids];
Existe-t-il un moyen d'utiliser une boucle for dans une méthode séparée qui dira à chaque objet dans mon tableau de se déplacer? –