Search code examples
iphoneobjective-csearchdisplaycontrollerivar

How to create an ivar for searchDisplayController


following this question, how would I create an "ivar" as mentioned? Ran into this same issue and I'm trying to work around it so apple will approve my latest update


Solution

  • In the header file:

    @interface MyClass : Superclass {
         UISearchDisplayController *mySearchDisplayController;
    }
    

    In the implementation:

    mySearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
    

    And in -dealloc:

    [mySearchDisplayController release];