Comment puis-je ajouter un UISearchDisplayController à un UIView? Interface constructeur ne me laisse pas.Comment puis-je ajouter un UISearchDisplayController à un UIView?
0
A
Répondre
0
Un UISearchDisplayController ne peut être ajouté à un UIView parce qu'il ne hérite pas d'un UIView. Vous pouvez ajouter un UISearchBar dans le générateur Interface avec un IBOutlet, puis créer un UISearchDisplayController avec ce UISearchBar par programmation.
0
Faites-le simplement en code, par ex. (En supposant que le contrôleur de vue est vc):
[vc addSubview:mySearchDisplayController.searchBar];
// Note that searchBar is the view, and mySearchDisplayController only CONTROLS the searchBar etc.