2010-07-02 50 views
0

我正在使用sectionIndexTitlesForTableView在UITableView中顯示索引。它工作正常,但我使用相同的TableView顯示的東西,我不需要此索引。所以,問題是如何刪除sectionIndex?動態刪除SectionIndex

+0

您是否嘗試過回零和重裝的部分指標? – Eiko 2010-07-02 21:40:46

回答

0

使用BOOL值來跟蹤顯示您正在使用(第一或第二)和做這樣的事情(isDisplayingFirst是一個布爾值):

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView 
{ 
    if (isDisplayingFirst) { 
     // return your section index titles 
    } 
    return nil; // otherwise return nothing 
}