0
我的計劃是在與來自JSON部分已分組的tableview從web服務獲取一個JSON和顯示結果。從JSON來UiTableViewControll
我的JSON SOFAR:
{
"Building 1":[{"title":"Room 1","id":"1"},{"title":"Room 2","id":"11"},{"title":"Room 3","id":"12"}],
"Building 2":[{"title":"Room 1","id":"37"},{"title":"Room 2","id":"23"}],
"Building 3":[{"title":"Room 1","id":"9"},{"title":"Room 2","id":"3"}]
}
我可以把它拿來和寫出來的
-(void)connectionDidFinishLoading: (NSURLConnection *)connection
{
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:nil];
NSLog(@"array contains %@",json);
[self.tableView reloadData];
}
但如何做休息,並顯示在與節頭一個實現代碼如下: 1號樓 房間1 室2 室3 2號樓 房間1
等等?
你嘗試過什麼?有教程的色調有關使用的UITableView /的UITableViewController – 2013-02-25 09:03:41
我曾嘗試:HTTP://stackoverflow.com/questions/12703912/how-to-set-numberofsectionsintableview-titleforheaderinsection-using-dynamic-js但它的所有關於valueForKey與我不有。 – user2106600 2013-02-25 10:16:24
我只是需要幫助,指導我如何使用此進行正確的方向。如何將NSDictionary中轉換的東西的例子我能在numberOfSectionsInTableView和titleForHeaderInSection使用 – user2106600 2013-02-25 10:59:25