I am trying to feed the content of a masterview after creating a project based on the master/detail app template.
I have basically a model that content all my data which might change later on. I want to feed automatically the content of the tableview by providing the number of rows per section and number of sections that has this model.
我可以这样做,超越以下两项职能:
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
我只字不提总书记长的故事板——总书记,这反映了比我的模型多的章节和行文。
e.g:我用1节和1行离开主食故事板。 如果在“OfRowsIn”栏中恢复2,那么我的方案将随着“NSRangeExceptionError”的错误而发生:
2011-10-10 14:38:53.042 sample_project[3636:f803] *** Terminating app due to uncaught exception NSRangeException , reason: *** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]
*** First throw call stack:
(0x13bb052 0x154cd0a 0x13a7674 0x432805 0x24227a 0x1ed548 0x1ef722 0x9f7c7 0x9f2c1 0xa228c 0xa6783 0x51301 0x13bce72 0x1d6592d 0x1d6f827 0x1cf5fa7 0x1cf7ea6 0x1d8330c 0x114c6 0x11bd6 0x20743 0x211f8 0x14aa9 0x12a5fa9 0x138f1c5 0x12f4022 0x12f290a 0x12f1db4 0x12f1ccb 0x112a7 0x12a9b 0x25e2 0x2555)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)
是否有任何人认为这样做的理由? 我失踪了吗? 难道我需要做一些额外的开端,这将为控制者的Load功能中的表象设定一个缺省规模?