2016-05-26 16 views
0

私はUITableViewControllerの子であるListViewControllerスーパークラスを作成し、ListViewControllerの子であるCoutryListViewControllerを作成しますが、CountryListViewController.mではnumberOfRowsInSection関数は呼び出されません。以下のような子のnumberOfRowsInSection関数は呼び出されませんか?

CountryListViewController.m実装で
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 

if ([tableView isEqual:self.searchDisplayController.searchResultsTableView]) { 
    // search 
    return 1; 
} 
return self.indexTitles.count; 
} 

::のようなListViewController.m実装で

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 

if ([tableView isEqual:self.searchDisplayController.searchResultsTableView]) { 
    // search 
    return self.searchResults.count; 
} 
NSLog(@"statesArray count: %ld", self.statesArray.count); 
return self.statesArray.count; 
} 

答えて

0

ええ、私は間違って何を知っています。スーパークラスのnumberOfSectionsInTableView関数は常に0を返します。

関連する問題