Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

[NSProxy doesNotRecognizeSelector:_accessibilityValueForKey:] #42

Open
rounak opened this issue Dec 26, 2014 · 16 comments
Open

[NSProxy doesNotRecognizeSelector:_accessibilityValueForKey:] #42

rounak opened this issue Dec 26, 2014 · 16 comments

Comments

@rounak
Copy link

rounak commented Dec 26, 2014

 -[NSProxy doesNotRecognizeSelector:_accessibilityValueForKey:] called!
Thread : Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x27f0a5f7 __exceptionPreprocess + 126
1  libobjc.A.dylib                0x3577cc77 objc_exception_throw + 38
2  CoreFoundation                 0x27f0a53d -[NSException initWithCoder:]
3  Foundation                     0x28c10181 -[NSProxy doesNotRecognizeSelector:] + 68
4  CoreFoundation                 0x27f0d999 ___forwarding___ + 712
5  CoreFoundation                 0x27e3eb88 _CF_forwarding_prep_0 + 24
6  UIKit                          0x2662b859 -[UIScrollViewAccessibility _axCleanupDelegateClearer] + 100
7  UIKit                          0x2662b765 -[UIScrollViewAccessibility clearDelegateClearer] + 24
8  UIKit                          0x2662ba91 -[UIScrollViewAccessibility setDelegate:] + 28
9  UIKit                          0x2b4541f7 -[UICollectionView setDelegate:] + 46
10 Design Shots                   0x00184f39 -[TLYShyNavBarManager dealloc] (TLYShyNavBarManager.m:122)
@Mazyod
Copy link
Contributor

Mazyod commented Jan 6, 2015

Does this error triggers while performing UI Testing?

@rounak
Copy link
Author

rounak commented Jan 6, 2015

No this was in my crashlytics crash logs. I'm guessing someone had accessibility enabled?

@Mazyod Mazyod added the bug label Jan 6, 2015
@Mazyod
Copy link
Contributor

Mazyod commented Jan 6, 2015

Yeah, possibly. I've never looked deep into accessibility features. I'd really like to move away from the NSProxy, in general, and that gives a good incentive.

@skela
Copy link
Contributor

skela commented Mar 13, 2015

right, so i've started setting stuff in viewWillAppear and unsetting it in viewDidDisappear with much better behaviour, and no more crashes ;)

@Mazyod
Copy link
Contributor

Mazyod commented Mar 13, 2015

@skela Thanks for your input! I'll remove the erroneous comment, I hope you don't mind.

@yuriferretti-luizalabs
Copy link

@skela I'm facing the same issues in my app, so could you tell me what exactly are you setting and unsetting in viewWillAppear and viewDidDisappear?
Here I'm only doing this setup in viewDidLoad

shyNavBarManager.scrollView = collectionView
shyNavBarManager.extensionView = header
shyNavBarManager.stickyExtensionView = true

@Mazyod
Copy link
Contributor

Mazyod commented Dec 3, 2015

@yuriferretti-luizalabs Hey, how about you try to implement _accessibilityValueForKey in the TLYDelegateProxy and just make it a blank? I'd prefer if you declare the method in a private NSObject extension, and pass the call to middleMan, but I am not sure how important this call really is.

@yuriferretti-luizalabs
Copy link

I'm afraid of implementing this method because it's certainly a private API and apple could reject applications using it. Correct me if I'm wrong

@Mazyod
Copy link
Contributor

Mazyod commented Dec 4, 2015

@yuriferretti-luizalabs you're absolutely right, however I was under the impression it only happens on the simulator because of #34. You can surround it with macros #if to make sure it doesn't make it to production? Does it actually happen on device?

@yuriferretti-luizalabs
Copy link

@Mazyod it's happening to me in production code since crashlytics reported some crashes to me. I will dig deeper when this accessibity method is called to find a solution.

@Mazyod
Copy link
Contributor

Mazyod commented Dec 4, 2015

@yuriferretti-luizalabs Got it, thanks. That hack won't do then... Thanks for looking into it, I'm doing some preliminary research, but nothing is coming up.

@skela
Copy link
Contributor

skela commented Dec 4, 2015

@yuriferretti-luizalabs

I don't use the stickyExtension stuff, all I do is:

  -(void)viewWillAppear:(BOOL)animated
  {
    [super viewWillAppear:animated];

    header.frame = CGRectMake(0,0,self.view.bounds.size.width,header.frame.size.height);
    [shyNavBarManager setScrollView:collectionView];
    [shyNavBarManager setExtensionView:header];
  }
  -(void)viewDidDisappear:(BOOL)animated
  {
    [super viewDidDisappear:animated];
    [shyNavBarManager setScrollView:nil];
    [shyNavBarManager setExtensionView:nil];
  }

@yuriferretti-luizalabs
Copy link

@skela thanks! I'll try it

@yuriferretti-luizalabs
Copy link

@skela when doing that my extension view ignores user interaction

@skela
Copy link
Contributor

skela commented Dec 14, 2015

@yuriferretti-luizalabs I would look into yer own class / view controller if that is the case, as I don't see why that should come from shy nav bar ;)
The only thing I can think of is perhaps your frame is wrong for whatever view yer adding as the extension view? I only added my header frame setting code for a specific scenario, perhaps you don't need that. As far as I can tell, there's nothing in the shy nav bar code that disables user interaction.

@skela
Copy link
Contributor

skela commented Dec 14, 2015

@yuriferretti-luizalabs another thing worth mentioning is that my view controller is a UIViewController subclass, not a UITableViewController or UICollectionViewController. As far as I remember, there were some issues when using the UITableViewController / UICollectionViewController classes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants