setSearchDisplayController considered private-API?

前端 未结 3 1128
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-23 22:02

I recently submitted an app for app review but I got rejected because of the use of a private API. I\'m still a bit new to iPhone developing so I was wondering if someone could

相关标签:
3条回答
  • 2021-01-23 22:24

    Is -setSearchDisplayController: mentioned anywhere in the documentation (I don't think it is)? If it is not then it's not a public API.

    The fact that you have to use -performSelector:withObject: and can't call it directly is another giveaway. -setSearchDisplayController obviously isn't included in any header files.

    0 讨论(0)
  • 2021-01-23 22:49
    [self performSelector:@selector(setSearchDisplayController:) withObject:searchDisplayController];
    

    Is a private API call and it can cause an app rejection by Apple, I know because it happened to an app I'm working on.

    0 讨论(0)
  • 2021-01-23 22:51

    From Apple's UIViewController doc:

    @property(nonatomic, readonly, retain) UISearchDisplayController *searchDisplayController
    This property reflects the value of the searchDisplayController outlet that you set in Interface Builder. If you create your search display controller programmatically, this property is set automatically by the search display controller when it is initialized.

    0 讨论(0)
提交回复
热议问题