Erkennen bestimmtes Objekt mit UITouch

HALLO . ich versuche eine UIImageView Objekt mit UITouch und habe problem mit dem code wie kann ich die implementieren UITouch zu erkennen, nur meine UIImageView Objekt ?

**imageA es meine UIImageView

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

        UITouch *toucheA = [[event allTouches] anyObject];

    if ([toucheA view] == imageA) {
        CGPoint location = [toucheA locationInView:self];
        imageA.center = location;       

    }
}

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

    [self touchesBegan:touches withEvent:event];
    CGPoint postion = imageA.center;
    imageA.center = postion;
    postion.y = 230;
    imageA.center = postion;

}

aber funktioniert nicht !

InformationsquelleAutor Momi | 2010-09-10

Schreibe einen Kommentar