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

  • Home
  • SEARCH
  • 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 6700613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:50:08+00:00 2026-05-26T06:50:08+00:00

I am using this class: https://github.com/alexleutgoeb/ALPickerView Since I converted to ARC, I get this

  • 0

I am using this class:

https://github.com/alexleutgoeb/ALPickerView

Since I converted to ARC, I get this error after clicking on the pickerview a couple of times:

2011-10-18 14:10:19.424 MappingApp[3398:10d03] An instance 0x73c7cd0 of class CustomTapGestureRecognizer was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info: <NSKeyValueObservationInfo 0x5d93430> (<NSKeyValueObservance 0x5d933f0: Observer: 0x5d66eb0, Key path: state, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x746b180>)

The error points to the CustomTapGestureRecoginizer class and the last line of this method:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    // Simple hack, set recognizer state to possible as tap begins
    self.state = UIGestureRecognizerStatePossible;
}

In checkview, I have this method:

- (void)didMoveToSuperview {
    gestureRec = [[CustomTapGestureRecognizer alloc] initWithTarget:nil action:nil];
    gestureRec.numberOfTapsRequired = 1;
    [gestureRec addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil];
    [[self superview] addGestureRecognizer:gestureRec];
}

And, the removeObserver, which I know can cause this problem is in checkview’s dealloc. Should I move this somewhere else? Does anyone have any other ideas what might be causing this problem? It never happened before ARC.

  • 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-26T06:50:08+00:00Added an answer on May 26, 2026 at 6:50 am

    I would guess that the method didMoveToSuperview in the CheckView class is called more than once causing the gestureRec instance variable to be reassigned and the previous CustomTapGestureRecognizer instance considered to have no references left by ARC and then be dealloced (causing the warning message that someone is still observing the instance).

    Try to add NSLog(@"didMoveToSuperview: self=%@ gestureRec=%@", self, gestureRec); to the beginning of didMoveToSuperview to see if this is the case.

    If so a quick fix is probably something like this but I haven’t tried it myself or know much about the code.

    - (void)didMoveToSuperview {
      if (gestureRec != nil) {
        [gestureRec removeObserver:self forKeyPath:@"state"];
      }
      gestureRec = [[CustomTapGestureRecognizer alloc] initWithTarget:nil action:nil];
      gestureRec.numberOfTapsRequired = 1;
      [gestureRec addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil];
      [[self superview] addGestureRecognizer:gestureRec];   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using amazon S3 service with PHP by using this API https://github.com/tpyo/amazon-s3-php-class I
I'm using abraham's twitter oauth class (https://github.com/abraham/twitteroauth) to connect and update twitter. I had
I'm using this great plugin: https://github.com/maranomynet/linkify/blob/master/1.0/jquery.linkify-1.0.js to link text manipulating the dom. The problem
I am using this http://github.com/professionalnerd/simple-private-messages plugin in rails and I am on a user
I can compile this JNA example code (from step 2 of https://github.com/twall/jna/#getting_started ): package
Recently I started using https://github.com/crowdint/rails3-jquery-autocomplete It works great, but I was trying to set
I've been following the tutorial on the Devise github page here: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign_in-using-their-username-or-email-address I'm in
I am using the linkedin gem https://github.com/pengwynn/linkedin I authorize using Omniauth and store the
This link: https://github.com/probertson/air-sqlite/blob/DB-copy-dev/src/com/probertson/data/DBCopier.as has an interesting class to do just that! Encrypt an unencrypted
I using sorcery for email activation and I've followed their wiki tutorial: https://github.com/NoamB/sorcery/wiki/User-Activation .

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.