2013-01-12 119 views
0

虽然使用下面的代码时,我接触的对象的对象被摇动,多对象拖动

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
    { 
UITouch *touch = [[event allTouches] anyObject]; 
    if ([touch view] == img1) 
    { 
     CGPoint location = [touch locationInView:touch.view]; 
     img1.center = location; 
     return; 
    } 
    if (touch.view == img2) 
    { 
     CGPoint location = [touch locationInView:touch.view]; 
     img2.center = location; 
     return; 
    } 
    } 
    -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { 
[self touchesBegan:touches withEvent:event]; 
    } 

这是在我的代码的问题,是否有任何其他的方法来拖动和dragin多对象如果视图包含多一个对象?请帮我解决这个问题

回答

0

我觉得如果你是在谈论更多的物体一次全部拖然后从你接触begain方法

+0

的具有1M mutilple对象,你应该删除的回报,但我一次拖一个,同时删除塔retun也不工作公关opely, –