UISearchDisplayController not working when created in code?

前端 未结 2 1712
执念已碎
执念已碎 2021-02-09 12:34

I\'m working on a tab bar application and one of the tabs has a UISearchDisplayController hooked up to a UISearchBar. It\'s all connected up in the NIB and is working. When I ta

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-09 13:22

    Wow, I just figured out the problem.

    I figured, because the searchDisplayController property for the UIViewController is set inside the initWithSearchBar:contentsController: message I would still autorelease my copy of the pointer, but when I removed the autorelease the stupid thing started working. Gaaaah. Why would it not retain its own copy (the UIViewController)?

提交回复
热议问题