ABPeoplePickerNavigationController completion handler trying to find text in the cells and get Null

StackOverflow https://stackoverflow.com/questions/13362297

  •  29-11-2021
  •  | 
  •  

Question

Got a ABPeoplePickerNavigationController and after its displayed I want to search through the cells and find the text i.e. user names displayed. I then want to check the users if they are contained in a coredata NSSet... My issue, I can't seem to get the text back from the cells just Null. I know the cells are the correct ones as I can happily play with the cell accessory type. Sample code shown:

[self presentViewController:picker animated:YES completion:^{
 // Find the picker tableViewController
    UIView *view = picker.topViewController.view;
    UITableView *tableView = nil;
    for(UIView *uv in view.subviews)
    {
        if([uv isKindOfClass:[UITableView class]])
        {
            tableView = (UITableView*)uv;
            break;
        }
    }

// Check tableView not Null then Loop occurs here with this code in it always giving me Null
// I know the tables populated and displayed at this point so why Null ?
 .......       

 NSString *a = [[[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:x]] detailTextLabel] text];

 .......
}];
Was it helpful?

Solution

Starting to think this could be related to ios6 privacy controls ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top