大家好我想使用webservice部分,所以如果我在webservice uirefresh中分组,每个新数据都应该添加一个新的部分。我可以使用date或head_line对数据进行分组,感谢您的帮助
{
succeed: 1,
message: "succeed",
data: [
{
id: "1144",
date: "11.09.2013",
time: "16:20",
code: "AKGUV",
head_line: "content ",
news: "Lorem ipsum dolar",
news_id: "20130911162025",
company_id: "1979"
}, {
id: "1145",
date: "11.09.2013",
time: "16:20",
code: "AKGUV",
head_line: "content ",
news: "Lorem ipsum dolar",
news_id: "20130911162025",
company_id: "1979"
}, {
id: "1146",
date: "11.09.2013",
time: "16:20",
code: "AKGUV",
head_line: "content ",
news: "Lorem ipsum dolar",
news_id: "20130911162025",
company_id: "1979"
}]
}
答案 0 :(得分:1)
如果你想要一个分组/分区的tableView,你的数据可能需要是一个多维数组。可能你需要一个NSMutableArray,你可以根据你的参数创建一个新的NSArray,并将NSArray添加到NSMutableArray。
NSArray* array = [webserviceDictionary objectForKey:data]; [mutArray addObject:array];