私は部門のクリックで、コードがIOS 3.0と4.o に適していますとき、私は、コードを実行すると、コードがテーブルビューをクリックしてIOS 5.0で実行するとアプリケーションがクラッシュする。
- (NSArray*)indexPathsInSection:(NSInteger)section {
NSMutableArray *paths = [NSMutableArray array];
NSInteger row;
for (row = 0; row < [self numberOfRowsInSection:section]; row++)
{
[paths addObject:[NSIndexPath indexPathForRow:row inSection:section]];
}
return [NSArray arrayWithArray:paths];
}
- (void)toggle:(BOOL*)isExpanded section:(NSInteger)section {
*isExpanded = !*isExpanded;
[Table beginUpdates];
if (!*isExpanded)
{
NSArray *paths = [self indexPathsInSection:section];
[Table deleteRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationFade];
}
else {
NSArray *paths = [self indexPathsInSection:section];
[Table insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationRight];
}
[Table endUpdates];
[Table reloadData];
}
- (NSInteger)numberOfRowsInSection:(NSInteger)section {
if(kMAX_SECTION_ROWS[section] == 0)
{
return 1;
}
else
{
return kMAX_SECTION_ROWS[section];
}
//return 0;
}
- (void)toggleSection:(id)sender {
NSLog(@"button %d is clicked.",[sender tag]);
int i = [sender tag];
if(!isSectionExpanded[i]){
NSLog(@"expanded");
hString[i].arrowImage.image = [UIImage imageNamed:@"downarrow.png"];
}
else {
NSLog(@"not expanded");
hString[i].arrowImage.image = [UIImage imageNamed:@"arrowgrean.png"];
}
[self toggle:&isSectionExpanded[i] section:i];
}
のように見えるの細胞の退色を表示するコードを行っていますIOS 5それは私を示し、エラー
Assertion failure in -[_UITableViewUpdateSupport _computeRowUpdates],/SourceCache/UIKit_Sim/UIKit-1912.3/UITableViewSupport.m:386
は、任意の手掛かりは、その後のおかげ
これまでにバグを追跡するために何をしましたか? – Monolo
私は番号を確認しようとしました。テーブルビューのセクションと実行時のnセクションの行数を取得しました。これはIOS 3.0と4.0でうまくいきます。 – bhavin
ありがとうございましたが、今は別の方法で処理しています – bhavin