Reputation: 34
I want to create a menu structure in iOS with sub menu content. I get following dictionary from:
{
"post_Type": "subject",
"head": "Edho",
"abbreviation": "histophya”,
"title": "Edho",
"body": "Edho",
"Tree": [{
"post_Type": "topic",
"head": "Edho/teaologie",
"title": "<span>teaologie</span>",
"body": "teaologie"
}, {
"post_Type": "topic",
"head": "Edho/abcedf",
"title": "<span>abcedf</span>",
"body": "abcedf"
}, {
"post_Type": "topic",
"head": "Edho/his+food+system+and+blut",
"title": "<span>his-food-system-and-Blut</span>",
"body": "his food system+and+blut"
}, {
"post_Type": "topic",
"head": "Edho/Lump+abcedf+and+immunsystem",
"title": "<span>Lump abcedf and Immunsystem</span>",
"body": "Lump+abcedf+and+immunsystem"
}, {
"post_Type": "topic",
"head": "Edho/rationsystem",
"title": "<span>rationsystem</span>",
"body": "rationsystem"
}, {
"post_Type": "topic",
"head": "Edho/varadha",
"title": "<span>varadha</span>",
"body": "varadha",
"Tree": [{
"post_Type": "topic",
"head": "Edho/varadha/grand",
"title": "<span>grand</span>",
"body": "grand"
}, {
"post_Type": "topic",
"head": "Edho/varadha/mand+and+rachen",
"title": "<span>mand and Rachen</span>",
"body": "mand+and+rachen",
"Tree": [{
"post_Type": "module",
"head": "Edho/pen+wan+men+Edho",
"title": "<span>pen, wan, men: Edho</span>",
"body": "pen+wan+men+Edho"
}, {
"post_Type": "module",
"head": "Edho/zun+Edho",
"title": "<span>zun: Edho</span>",
"body": "zun+Edho",
"TreeContent": [{
"id": "Preview",
"title": "Preview"
}, {
"id": "n67adf05c9007ba58",
"title": "<span>Mark and Milk Abu</span>"
}]
}, {
"post_Type": "module",
"head": "Edho/zahne+Edho",
"title": "<span>zahne: Edho</span>",
"body": "zahne+Edho"
}]
}, {
"post_Type": "topic",
"head": "Edho/varadha/vada",
"title": "<span>vada</span>",
"body": "vada"
}, {
"post_Type": "topic",
"head": "Edho/varadha/poda",
"title": "<span>poda</span>",
"body": "poda"
}]
}, {
"post_Type": "topic",
"head": "Edho/end+orange",
"title": "<span>end orange</span>",
"body": "end+orange"
}, {
"post_Type": "topic",
"head": "Edho/horonorange",
"title": "<span>horonorange</span>",
"body": "horonorange"
}, {
"post_Type": "topic",
"head": "Edho/techtsorange",
"title": "<span>techtsorange</span>",
"body": "techtsorange"
}, {
"post_Type": "topic",
"head": "Edho/hat",
"title": "<span>hat</span>",
"body": "hat"
}, {
"post_Type": "topic",
"head": "Edho/system+and+sign",
"title": "<span>system and sign</span>",
"body": "system+and+sign"
}, {
"post_Type": "topic",
"head": "Edho/hot chips",
"title": "<span>hot chips</span>",
"body": "hot chips"
}]
}
Upvotes: 0
Views: 51
Reputation: 629
Use RATreeView which is the best pod for tree structure: http://cocoadocs.org/docsets/RATreeView/0.2.2/
RATreeView is a class designed to support implementation of the Tree View on IOS. It works as a wrapper for the UITableView, defining its own delegate and data source methods for easier managment for tree data structures.
As RATreeView is a wrapper for UITableView, most of delegate and data dource methods are just equivalents of specific methods from UITableView delegate and data source protocols. They are changed in the way they provide easier managment for the tree structures. There are also some new methods in protocols to provide support for expanding and collapsing rows of the tree view. It should work on IOS 5.0+.
Upvotes: 1