ABPeoplePickerView :: selectRecord... fails to scroll to selection

Originator:Pich.Dominik
Number:rdar://12129706 Date Originated:08-19-2012
Status:New Resolved:NO
Product:MacOSX SDK Product Version:10.8
Classification:Other Bug Reproducible:Always
 
Summary:
In my OSX app I have a ABPeoplePickerView. Then I want to make the view show a specific person. I call:
id *p = [[ABAddressbook sharedAddressbook] me];
[view selectRecord:p byExtendingSelection:NO];

Expected Results:
I expect the person to be SELECTED and VISIBLE.

Actual Results:
p is selected just fine but the view's internal table is not scrolled there

workaround:
NSTable *table = [view findInternalPeoplePickerTable];
[table scrollRowToVisible:[table selectedRow]];

=> problem: the workaround for this bug keeps me from releasing my software to the App Store as I use internal 'private' api?

--
Please see attached code which is a slightly modified version of the apple sample code: CocoaPeoplePicker. see focusMe: IBAction

==>

- (IBAction)focusMe:(id)sender {
    //select the right record
    ABPerson *me = [[ABAddressBook sharedAddressBook] me];
    [ppView selectRecord:me byExtendingSelection:NO];
    //=-> bug: tableView isnt scrolled!
    
    //
    //working hack
    //
    
    //get table
    id view = [ppView findSubviewOfKind:NSClassFromString(@"ABPeoplePickerTableView")];
    
    //scroll
    if([view respondsToSelector:@selector(scrollRowToVisible:)]
       && [view respondsToSelector:@selector(selectedRow)]) {
        
       [view scrollRowToVisible:[view selectedRow]];
    }
       
    //focus
    [[view window] makeFirstResponder:view];
}

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!