私は奇妙なエラーがあります。私はUITableView
を使用しています。これは、行が選択されたときにリロードする必要があります。これはiPhoneのシミュレータでうまく動作します。 iPadで実行中、didSelectRowAtIndexPath
が呼び出されていますが、UIが更新されていません。 メインスレッドでメソッドreloadData
を呼び出してみました。それはまだ同じです。TableView reloadDataはiPadのUIを更新しませんが、iPhoneで動作します
私はさまざまなソリューションをstackoverflowで試してみました。何も私の問題を修正するように見えませんでした。
UPDATE
私は、セルを選択すると、新しいセルが追加されます。だから私はテーブルビューを動的に変更を表示するためにリロードする必要があります。 は、あなたがテーブルビューの選択デリゲートメソッドでは、テーブルビューのデリゲート内のテーブルビューをリロードしている
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath
{
NSUInteger count=indexPath.row+1;
NSMutableArray *insertIndexPaths = [NSMutableArray array];
[insertIndexPaths addObject:[NSIndexPath indexPathForRow:count inSection:indexPath.section]];
switch (indexPath.row) {
case 0:
{
if ([ItemsInSection[indexPath.section] count]==1){
[ItemsInSection[indexPath.section] addObject:obj2];
[TabView beginUpdates];
[TabView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationLeft];
[TabView endUpdates];
}
else {
[ItemsInSection[indexPath.section] removeAllObjects];
[ItemsInSection[indexPath.section] addObject:obj1];
[self.TabView reloadData];
}
}
break;
case 1:
{if ([ItemsInSection[indexPath.section] count]==2){
[ItemsInSection[indexPath.section] addObject:obj3];
[self.TabView beginUpdates];
[TabView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationLeft];
[self.TabView endUpdates];
}
else
{
[ItemsInSection[indexPath.section] removeAllObjects];
[ItemsInSection[indexPath.section] addObject:obj1];
[ItemsInSection[indexPath.section] addObject:obj2];
[self.TabView reloadData];
}
}
break;
case 2: {
if ([ItemsInSection[indexPath.section] count]==3) {
[ItemsInSection[indexPath.section] addObject:obj4];
[self.TabView beginUpdates];
[TabView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationLeft];
[self.TabView endUpdates];
}
else
{
[ItemsInSection[indexPath.section] removeObject:obj4];
[self.TabView beginUpdates];
[TabView deleteRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationLeft];
[self.TabView endUpdates];
}
}
break;
default:
break;
}
}
コードを投稿する必要があります。それは私には問題はどこかにあると思う。また、セルを選択したときにテーブルビュー全体をリロードする理由は何ですか?あなたの努力がうまくいかないような解決策を探すのではなく、実際に達成しようとしている目標を記述してください。 – ozgur