0
我有6的NSMutableArray(週一,週二......週六),我添加到NSMutableArray的「天」 我在這個方法中做「numberOfRowsInSection」的UITableView numberOfRowsInSection
NSArray *array = [day objectAtIndex:section];
return [array count];
所有的工作,但是當我添加項目我有項目只有當我重建項目,或者如果我刪除行我有錯誤
斷言失敗 - [UITableView的_endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:995
由於未捕獲的異常'NSInternalInconsistencyException'而終止應用程序,原因:'無效的更新:第0節中的行數無效。
更新(3)後現有節中包含的行數必須等於在更新前包含在該部分中的行(3),加上或減去從該部分插入或刪除的行數(0插入,1刪除)。
,如果我這樣做的方法一切正常,但我需要做的第一個方法,在二,三線
if(section==0)
return [monday count];
if(section==1)
return [tuesday count];
if(section==2)
return [wednesday count];
if(section==3)
return [thirsday count];
if(section==4)
return [friday count];
if(section==5)
return [saturday count];
謝謝,所有工作 – Pavel 2012-02-03 13:06:53