Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7562129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:20:14+00:00 2026-05-30T13:20:14+00:00

I am setting the UIGestureRecognizer for iPhone App. I am doing it in InterfaceBuilder

  • 0

I am setting the UIGestureRecognizer for iPhone App.
I am doing it in InterfaceBuilder by dragging Long Press Gesture Recognizer from Objects library to the view which must accept gestures.

After I add a Gesture Recognizer in this way, it has Referencing Outlet Collection pointing to the view which should accept the gesture.

Then in ViewController I add an IBOutlet pointing to the GestureRecognizer

IBOutlet UILongPressGestureRecognizer *gestRec;

and corresponding action for the Gesture Recognizer

-(IBAction)longPress:(id)sender;

So after it Gesture Recognizer shows in Interface builder the outlet and the action named longPress: with target named ControlManager

But my program crashes when I make long press gesture in iPhoneSimulator. When I NSlog the description of my GestureRecognizer it shows the following output:

<UILongPressGestureRecognizer: 0x6859620; 
state = Possible; 
view = <UIView 0x6859e20>; 
target= <(action=longPress:, target=<ControlManager 0x6859af0>)>>

I think that problem is in last line and that it should look like this:

target=<ControlManager 0x6859af0>; 
action=longPress:

Am I doing something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:20:15+00:00Added an answer on May 30, 2026 at 1:20 pm

    Did you implement -(void)longPress:(UIGestureRecognizer)recognizer in your .m? (I am suggesting updating the id -> UIGestureRecognizer and sender -> recognizer; IBAction is typedef to void but you might make it explicit)

    You definitely want to implement the selector, and this type of crash is very common when the method (if implemented at all) doesn’t match the selector. Even missing the colon could cause a mismatch.

    Also, have you set up the debugger to break when an exception is raised? If not, go to debugger (6th “tab” from left on left pane), click + to add a new one, “Add Exception Breakpoint”, and keep defaults). This will push you into the debugger as soon as an exception is raised, which is usually a useful place to be in the stack.

    Good luck,

    Damien

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Setting arbitrary attributes from outside works for normal classes, but not for internal objects
After setting up TemplaVoila like ever i end up in this view. I set
Setting up a simple grails app with Dojo, i used the grails install-plugin dojo
Setting a page title I have the following MVC View Syntax <title> Category :
setting QItemSelectionModel crashes my app. Anyone knows how to solve this? #ifndef DIALOG_H #define
An app I am developing requires a three-point swipe gesture. I have successfully implemented
i am trying to implement my own gesture recognizer in addition to the one
Setting up the urls for a Django app called OmniCloud_App . Getting and error
I'm working in small app for iPhone which uses openGL. The app is supposed
Setting up an integration server, I’m in doubt about the best approach regarding using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.