Domanda

This is my problem, i want do it in multiple buttons and i only do it with one button...

-(void)viewDidLoad
{
UILongPressGestureRecognizer *longpressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandler:)];
longpressGesture.minimumPressDuration = 3;
[longpressGesture setDelegate:self];

[self.pieza11 addGestureRecognizer:longpressGesture];
[self.pieza12 addGestureRecognizer:longpressGesture];
[self.pieza13 addGestureRecognizer:longpressGesture];
[self.pieza14 addGestureRecognizer:longpressGesture];

    [longpressGesture release];

}

È stato utile?

Soluzione

one gesture works for one object only. so in your case it might be working with the last one pieza14.

if you want this for all then you have to add separate UILongPressGestureRecognizer to all buttons.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top