[英]Failing to add tableview to uiview
I'm dynamically creating uiviews which contain uitableviews (uiviews are tableview and datasource delegates for their respective tables. The uiviews are created using a xib file). 我正在动态创建包含uitableviews的uiviews(uiviews是它们各自表的tableview和数据源委托。uiviews是使用xib文件创建的)。 When I reach the numberOfRowsInSection function and try to return [self.mydata count], mydata is empty.
当我到达numberOfRowsInSection函数并尝试返回[self.mydata count]时,mydata为空。
Any thoughts? 有什么想法吗?
I figured out my issue. 我知道了我的问题。 I was setting the uitableviewdelegate and uitableviewdatasource to the uiview in the xib file, when in fact I want the File's Owner (which is the specific uiview created at runtime).
我实际上在需要文件的所有者(这是在运行时创建的特定uiview)时,将uitableviewdelegate和uitableviewdatasource设置为xib文件中的uiview。
I simply clicked and dragged (in the xib file) from the delegate and datasource outlets to the File's Owner placeholder button thing. 我只是单击并从委托和数据源出口(在xib文件中)拖到“文件的所有者”占位符按钮处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.