English 中文(简体)
• 积极宣传主/尾 the总经理的总结
原标题:Issue feeding dynamically the uitableview in the masterview controller of a master/detail app

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功能中的表象设定一个缺省规模?

最佳回答

我发现,缺省表认为内容归属是固定的。 您可以将其改为动态原型。 您需要为小组提供识别资料: 我不知道如何使用。 这解决了上文提到的坠毁事件。

问题回答

你们的法典实际上会有所帮助,但会有任何帮助,

IOS5对IDKit做了一些改动,对以下链接进行核查,以便你在法典中任何地方解决冲突。

IOS 5 Release Notes

There is a change in the NSIndexPath too, check that particularly. As per apple docs,

指数PathForRow:在以下各节中,NSIndexPath的分流方法现在使用NSInteger而不是NSUInteger,以便这些类型与可读书界定的方法相匹配。

If you find the answer, please share.





相关问题
Plist Hierarchy and All Option

I have a string of data in a plist, which I ve got to display, hierarchically like this: Menu>Chapter>SubChapter>item>item details This might be super simple, in my initial menu, how would I have ...

Disable iPhone table rows

Is there any way to disable the "selectibility" of a UITableView row? Example: I would like to make an appointment for a haircut at a certain time with a certain stylist. What gets displayed to a ...

Nonintrusive visual cue for uitableviewcell

I d like to mark a tableview row in some way that shows it has been clicked by the user. I have a large number of rows and want users to know if they have already visited a particular row. This same ...

TableView oval button for Index/counts

Can someone help me create an index/count button for a UITableView, like this one? iTunes http://img.skitch.com/20091107-nwyci84114dxg76wshqwgtauwn.preview.jpg Is there an Apple example, or other ...

Unable to pushViewController for subview

I have a UINavigationController and I have seperate UIViews that I switch between using a UISegmentControl. On switching the views, I add the view as a subview to my navigation controller s view: [...

热门标签