title: Add Longpress gesture and Click event on UIButton
body: <p>I am new to iPhone.</p>
  
  <p>I want to add both a long press gesture and a click event to my Button, is this possible?</p>
  
  <p>When I add both events to the button and then long press, my click event gets fired (on click I navigate to a new page), but my long press event never gets fired.</p>
  
  <p>Here is my code snippet:</p>
  
  <pre><code>button = [UIButton buttonWithType:UIButtonTypeCustom];
  button.frame = CGRectMake(xpos, ypos, 120,130);
  [button setBackgroundImage:[UIImage imageNamed:@"ibook2.png"] forState:UIControlStateNormal];
  [button setTitle:[NSString stringWithFormat:@"32"]];
  [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchDown];
  
  LongPress = [[UILongPressGestureRecognizer alloc] init];
  [LongPress addTarget:self action:@selector(longPressDetected:)];
  LongPress.delegate = (id&lt;UIGestureRecognizerDelegate&gt;)self;
  [button addGestureRecognizer:LongPress];
  [LongPress release];
  
  [self.view addSubview:button];
  </code></pre>
  
  <p>How do I add both events?</p>
  
  <p><strong>Any help will be appreciated.</strong></p>