0
我用下面的代碼來調用UITableView
單元測試的UITableView
-(void)testJumpSection
{
NSIndexPath *indexPath1= [NSIndexPath indexPathForRow:0 inSection:0];
[viewControllerObject tableView:viewControllerObject.masterTableView didSelectRowAtIndexPath:indexPath1];
int backButtonSection = viewControllerObject.backButtonSection;
NSIndexPath *indexPath2= [NSIndexPath indexPathForRow:0 inSection:2];
[viewControllerObject tableView:viewControllerObject.masterTableView didSelectRowAtIndexPath:indexPath2];
int backButtonSection2 = viewControllerObject.backButtonSection;
[viewControllerObject backButtonView:viewControllerObject.button1];
int backButtonSectionTestValue = viewControllerObject.backButtonSection;
STAssertTrue(backButtonSectionTestValue==1, @"TestJumpSection");
}
我寫這篇測試案例展開/摺疊uitableview.When用戶在部分0點擊行,然後點擊節3.現在用戶可以點擊後退按鈕導航第2節。現在我必須得到結果backButtonsection值減1。
它工作正常,但我無法獲得選定的部分值,並且我得到這個錯誤:
[__NSCFConstantString stringByAppendingString:]: nil argument"
有關我在做什麼錯的任何想法?
你從哪裏得到錯誤?你可以告訴我們你的'-tableView:didSelectRowAtIndexPath:'的實現嗎? – 2013-04-10 06:17:46
發佈一些更多的代碼。 – 2013-04-10 06:18:42
你有什麼問題可以理解錯誤信息嗎? – 2013-04-10 08:56:32