2010-06-17 80 views
1

我最近提交了一個應用程序審查的應用程序,但因爲使用私有API而被拒絕。我還是有點新iPhone發展,所以我在想,如果有人可以幫助我瞭解這部分是如何拒絕:setSearchDisplayController考慮private-API?

UISearchBar *searchBar = [[[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 0)] autorelease]; 
searchBar.showsCancelButton = NO; 
searchBar.placeholder = @"Search Exhibitors"; 
[searchBar sizeToFit]; 

[self.tableView setTableHeaderView:searchBar]; 

UISearchDisplayController *searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self]; 

[self performSelector:@selector(setSearchDisplayController:) withObject:searchDisplayController]; 

[searchDisplayController setDelegate:self]; 
[searchDisplayController setSearchResultsDataSource:self]; 
[searchDisplayController setSearchResultsDelegate:self]; 
[searchDisplayController release]; 

,他們提到的部分是「setSearchDisplayController」。我基於給出here的示例搜索UITableView。那麼任何人都可以解釋爲什麼這被認爲是一個私人API?

回答

1

-setSearchDisplayController:在文檔中提到的任何地方(我不認爲是這樣)? 如果不是,那麼它不是一個公共的API。

事實上,你必須使用-performSelector:withObject:,不能直接調用它是另一個贈品。 -setSearchDisplayController顯然不包含在任何頭文件中。

0
[self performSelector:@selector(setSearchDisplayController:) withObject:searchDisplayController]; 

是一個私人API調用,它可以導致Apple拒絕應用程序,我知道是因爲它發生在我正在處理的應用程序中。

0

從蘋果的UIViewController DOC:

@屬性(非原子,只讀,保留)UISearchDisplayController * searchDisplayController
這個屬性反映了您在Interface Builder中searchDisplayController出口的價值。如果 以編程方式創建您的搜索顯示控制器,則此 屬性會在初始化 時由搜索顯示控制器自動設置。