4

I have a main window which has two UITableViewControllers. On selecting the cell in first tableViewController (left pane), the tableViewContainer on the rightside gets populated. In the Voice over mode, I want that when the cell in the first tableViewController is selected, the first cell in the secondViewController gets focus so that the flick order starts from there. Please note that I have already tried the following two approaches:

1) Making the first cell of the second view controller, the firstResponder.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{          
    UITableViewCell *outCell =(UITableCellView*)  [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    if (indexPath.row == 0)
    {
        [outCell becomeFirstResponder];
    }
}

2) I also tried posting the layout changed notification given the cell as the first accessibility item.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{          
    UITableViewCell *outCell =(UITableCellView*)  [tableView dequeueReusableCellWithIdentifier:MyIdentifier];

     if (indexPath.row == 0)
     {
         UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, outCell);
     }
}

None of the above approaches worked. Any idea what else can I try or what is wrong with the above approaches?

Please note that: I have read the View controller’s documentation (https://developer.apple.com/LIBRARY/IOS/#featuredarticles/ViewControllerPGforiPhoneOS/Accessibility/AccessibilityfromtheViewControllersPerspective.html - Moving the VoiceOver Cursor to a Specific Element). Tried posting LayoutChanged notifications as well as ScreenChangedNotifications in my sample as well as tried with the sample code (ListAdder - http://developer.apple.com/library/ios/#samplecode/ListAdder/Introduction/Intro.html, which also uses the NavigationController as we does), but the above did not work even with the sample.

Any idea why?

Kasper Munck
  • 4,173
  • 2
  • 27
  • 50
Shilpi
  • 498
  • 1
  • 6
  • 13
  • Have you tried `UIAccessibilityScreenChangedNotification` instead? You could also try moving the notification to `tableView:willDisplayCell:forRowAtIndexPath`. – jszumski Apr 17 '15 at 17:59

1 Answers1

0

I solved this issue by posting the screen changed notification. The second parameter to that call is the table view's view that you want to select the first cell of.

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, [[self nextTableViewController] view];