2012-04-16 10 views
1

これは既存のバグか、これを修正するにはどうしようもありませんか?テーブルビューでボイスオーバーをオンにすると、テーブルセルが空になります。誰ですか?Xcodeのバグ? VoiceOver with TableView

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *CellIdentifier = @"tableCell"; 

//Exisint bug if using TableViewCell 
TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[TableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
} 
// Configure the cell. 
cell.pLabel.text = [self.tableArrayPlaces objectAtIndex:[indexPath row]]; 

return cell; 
} 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

NSString *selectedDest = [tableArrayPlaces objectAtIndex:indexPath.row]; 

//Get the selected country 
NSLog(@"SelectedDest %@", selectedDest); 
} 

編集:コードが追加されました。これは自分の細胞を移植するためのコードです。私がストーリーボードで「プッシュ」に設定しても、動作していないようです。どんな助け?

答えて

0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *CellIdentifier = @"tableCell"; 

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
} 
// Configure the cell.  
cell.text = [tableArrayPlaces objectAtIndex:[indexPath row]]; 

return cell; 
} 

私自身のcellViewを使用する代わりに、私はUITableViewCellを使用しました。これは私の問題を解決します。もちろん、ストーリーボードで直接リンクすることはできません。

0

これはiOSやコードにバグがある可能性がありますが、おそらくXcodeのバグではありません。

テーブルビューコントローラの-tableView:cellForRowAtIndexPath:メソッドを確認してください。空のセルが生成されたときに呼び出されていますか?いいえ、なぜでしょうか?はいの場合、正しくフォーマットされたセルが返されますか?連絡先などの他のアプリケーションで問題を再現できますか?

+0

良いアイデア。連絡先を使用しようとしました。問題ありません...私のコードだと思います。 – Hexark