hey i am running into a problem. i maade an image object that gets added every 2 seconds by an nstimer. and an update timer updates it so the image goes forward. but it only goes forward until a new one gets added and i can't solve why.
this is the method for adding it.
-(void)addTarget {
UIImage *image1=[UIImage imageNamed:@"enemy.png"];
image=[[UIImageView alloc]initWithImage:image1];
image.frame=CGRectMake(0,0,50,50);
[self.view addSubview:image];
image.center = CGPointMake(150, 150);
image.tag = 1;
[_targets addObject:image];
[image release];
}
self explaining.
-(void) update {
image.center = CGPointMake(image.center.x+2, image.center.y);
}
and this spawns them.
-(void) spawn {
[self addTarget];
}