detección de uiimageview iphone-no-global

Fondo: Estoy usando XCode 3.1.4, ten esto en cuenta. Por favor, no comente al respecto sin embargo.

Tengo que butttons, disparar y empezar. Cuando se presiona fuego, se crea un UIImageView llamado one usando la función IBAction. Cuando se presiona inicio, se crea una UIImageview llamada dos. Luego, cuando * se crea uno en la función IBACtion, llamo a otra función utilizando un NSTimer que pasa * uno como parámetro de información de usuario. Luego tengo una función de movimiento que se mueve * uno por 20 píxeles hacia abajo del eje y. Esto funciona perfectamente y puedo crear cientos de UIImageViews que se mueven simultáneamente. Hago lo mismo con inicio, pero con un UIImage diferente y * dos como el parámetro de información de usuario. Eso también funciona perfectamente. Sin embargo, quiero hacer un detector de colisiones para las UIImageViews creadas al hacer clic en estos botones. Dado que los punteros asignados a estos botones no son globales, no sé cómo hacerlo. Estoy publicando mi código a continuación:

-(IBAction)startWaves:(id)sender {
        start.hidden=YES;
    fire.hidden=NO;
    [NSTimer scheduledTimerWithTimeInterval:1 target:self   selector:@selector(createMeteors) userInfo:nil repeats:YES];


}


-(void)createMeteors{

    UIImageView *one = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Meteor.png"]];
    CGRect rectOne = CGRectMake(arc4random() % (310), arc4random() % (1), 35, 35);
    [one setFrame:rectOne];
    [self.view addSubview:one];
    [NSTimer scheduledTimerWithTimeInterval:0.4 target:self selector:@selector(moveMeteorOne:) userInfo:one repeats:YES];





}

- (void)moveMeteorOne:(NSTimer *)timerOne {
    UIImageView *one = timerOne.userInfo;
    one.center=CGPointMake(one.center.x, one.center.y + 15); 
    if (CGRectIntersectsRect(one.frame, image.frame)) {
        background.image = [UIImage imageNamed:@"gameOver.png"]; 
        fire.hidden = YES; 
        image.hidden=YES; 

    }
}


-(void)createBullets{
    UIImageView *two = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"lazerBeam.png"]];
    CGRect rectTwo = CGRectMake((image.center.x), (image.center.y - 45), 7, 20);
    [two setFrame:rectTwo];
    [self.view addSubview:two];
    [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(moveBulletOne:) userInfo:two repeats:YES];

}

-(void)moveBulletOne:(NSTimer *)timerTwo {
    UIImageView *two = timerTwo.userInfo;
        two.center=CGPointMake(two.center.x, two.center.y - 15); 

}

-(IBAction)fireBullets:(id)sender {

    [self createBullets]; 

}  

Respuestas a la pregunta(0)

Su respuesta a la pregunta