开发者

How to insert a section header into a uitableview from specific indices in a NSMutableArray?

开发者 https://www.devze.com 2023-03-29 21:28 出处:网络
I have an NSMutableArray with 20 objects inside that displays data as needed in a uitableview. I want to insert a section header at index 5,10 and 15 (from the array). How is this po开发者_C百科ssible

I have an NSMutableArray with 20 objects inside that displays data as needed in a uitableview. I want to insert a section header at index 5,10 and 15 (from the array). How is this po开发者_C百科ssible?


I think you will have to split that NSMutableArray into 4 arrays (items 1-5, 6-10, 11-15 and 16-20) and create an NSMutableArray with the section headers. Then, you can use those arrays to populate the UITableView.

0

精彩评论

暂无评论...
验证码 换一张
取 消