在 Xcode 的分组表视图中添加部分
我的代码与其他人有点不同,但它有效。
我是应用程序编码的新手,但我想添加一些 这些分为几个部分:
因此,其中一些人有自己的小组,每个小组都有一个小标题。
但我的代码如下所示:
,但我不知道要插入什么才能正确执行此操作。
(该图片的下半部分是详细视图中的图片,当您从表视图中选择某些内容时,它会显示在详细视图中。)
(我知道 Xcode 在我的代码中显示错误,但它仍然有效。)
任何人都可以帮我?
My code is a little different to others, but it works.
I am new to app coding, but I would like to add some of
these into sections:
So some of them have their own group with a small title to each.
But my code looks like this:
and I don't know what to insert to do it right.
(The bottom half of that picture is the pictures in the detail view, that shows up in the detail view when you select something from the table view.)
(I know Xcode shows errors in my code, but it still works. )
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须实现一些 UITableView 方法和委托方法(当然,将您的类设置为该类的委托):
这样,您就可以根据需要排列数据:每个部分一个数组,一个带子数组的大数组, ...如你所愿。只要您可以从上面的方法返回想要的值,Antthing 就可以了。
You have to implement some UITableView methods and delegate methods (and of course set your class as the delegate of the class) :
With that, you can arrange your data as you want : One array for each section, one big array with sub arrays, ... as you want. Antthing will be ok as far as you can return the wanted values from the methods above.