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 8165829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:39:27+00:00 2026-06-06T19:39:27+00:00

I have a gesture recognizer pulled from storyboard and it is working fine and

  • 0

I have a gesture recognizer pulled from storyboard and it is working fine and dandy…

EXCEPT when I simulate a low memory warning. At that point, it crashes with the error:

[UISwipeGestureRecognizer retain]: message sent to deallocated instance 0x8627330

To get it to not crash, what I have to do is set the gesture recognizer as a strong property and comment out the autogenerated set to nil in viewdidload:

//[self setSwipeGestureRecognizer:nil];

I got to this solution randomly, and Im hoping someone can explain what is going on here?

  • 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-06-06T19:39:28+00:00Added an answer on June 6, 2026 at 7:39 pm

    Fascinating. When you first posted this I was assuming that there was some problem with your code, but given your clarifying comments, I decided to try it out myself. I experience the same behavior you do.

    Specifically, I create a gesture recognizer in Interface Builder and linked it to an appropriate IBAction and confirmed it worked fine, even if I push to and pop from another view controller. But if I simulate a memory warning when at that secondary view controller, immediately upon return to the original view controller, I receive the same crash you do.

    It’s easily remedied. Looks like you have an approach, or you can simply bypass Interface Builder entirely, and create your own gesture recognizer in code, and you won’t have this problem, e.g.,

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        // Do any additional setup after loading the view.
    
        UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
        [self.view addGestureRecognizer:recognizer];
        // [recognizer release]; // uncomment in non-ARC project
    }
    

    If you create it manually like this, you don’t get the crash upon returning back to the view after simulating a memory warning. So that’s your solve.

    Fortunately, it looks like this has been remedied in the beta of the next version of Xcode and iOS.

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

Sidebar

Related Questions

I have a simple swipe gesture that I want to be very low priority.
CODE I have some code that adds a UILongPressGestureRecognizer gesture recognizer called _recognizer to
I have a pinch gesture recognizer attached to an imageview from which I use
I have a custom control/view that observes the direction of a gesture within its
In cellForRowAtIndexPath: method I have implemented gesture recognizer for long press, -(UITableViewCell *)tableView:(UITableView *)tableView
I have a pinch gesture recognizer attached to my scrollView (one on top of
I have a map drawn with OpenGLES, and I have a pan gesture recognizer
I have a UIImageView that's being loaded from a NIB. I've hooked up a
I have set up a gesture recognizer for my table cell in my IOS5
I have a UITableView with a gesture recognizer added: UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc]

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.