Yeah - I've made a small test project and can't reproduce the error.
Setting accessibilityLabel to @"" still seems to make it stop there as you swipe VO from element to element. I've got rid of it completely by setting accessibilityElementsHidden to YES.
Have narrowed down the problem some more. It seems to occur as soon as I set accessibilityIdentifier to a non-nil value (we use that in automated testing throughout the app).
UILabel* dn = [[UILabel alloc] initWithFrame:CGRectMake(15, 61, 250, 34)];
dn.accessibilityIdentifier = @"some text";
NSLog(@"DN-a11y A: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.isAccessibilityElement = NO; // Going to add the day name to the location name to make one item
NSLog(@"DN-a11y B: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.accessibilityIdentifier = nil;
NSLog(@"DN-a11y C: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.isAccessibilityElement = NO;
NSLog(@"DN-a11y D: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.accessibilityElementsHidden = YES; // Fixes the setIsAccessibilityElement not working by hiding it
[self.view addSubview:dn];
produces an output of:
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y A: YES
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y B: YES
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y C: NO
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y D: NO
which is very confusing. This exact same lump of code in a test project produces the expected output of 4 NO's.
Both projects running in same Xcode 4.6.3, targeting iOS5.0 running in simulator 6.1 or iPhone 5 with latest iOS (well, latest 6.X)
Very confusing. Obviously something in the setup/running of the main project causing the problem, but I've no idea on how to find out what!
On Fri, Jul 5, 2013 at 9:09 PM, David Dunham
<email@hidden> wrote:
Weird, I have code which is
label = [self smallLabelWithText: @"Ours" bold: NO top: &top left: usLeft width: valueWidth];
label.textAlignment = UITextAlignmentRight;
label.isAccessibilityElement = NO;
[fScroller addSubview: label];
and it seems just fine (the extraneous label gets skipped).
Can you change the accessibilityLabel to @"" as a workaround?
David Dunham
Twitter: @radiofreelunch http://www.pensee.com/dunham/
--
Richard Groves
Technical Director | NoodlFroot
M: +44 (0)7962 054 163
NoodlFroot Limited is a company registered in England and Wales with registration number 07245048.
Registered office: 145-157 St John Street, London, EC1V 4PY.