我有麻烦设置我的cellForRowAtIndexPath与部分。如果我只是显示所有“曲目”,而不用“主题”分割部分,那么它可以正常工作。UITableView与部分和解析数据如何创建cellForRowAtIndexPath
Track *aTrack = [appDelegate.tracks objectAtIndex:row];
cell.textLabel.text = aTrack.track_title;
我已经建立了我的numberOfSectionsInTableView,numberOfRowsInSection,titleForHeaderInSection。这些都很好。但我真的不知道如何设置cellForRowAtIndexPath。
经过研究一些最好的办法似乎使用一个NSDictionary中显示我的细胞......
NSDictionary *dictionary = [sectionTopicArray objectAtIndex:indexPath.section];
NSArray *array = [dictionary objectForKey:@"Tracks"];
NSString *cellValue = [array objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
能有人给我如何做一个MutableArray(sectionTopicArray)一些指针,是要保存所有我的字典?我可以在脑海中看到以下内容,但不知道如何在代码中进行说明。
sectionTopicArray
[0] Dictionary 1 with key Tracks
Track1
Track2
Track3
[1] Dictionary 2 with key Tracks
Track4
[2] Dictionary 3 with key Tracks
Track5
Track6
basically I'm thinking...
Section0 = Dictionary1 = Topic1
Section1 = Dictionary2 = Topic2
Section2 = Dictionary3 = Topic3
轨道数据在哪里?它是在设备上的SQLite数据库中,它驻留在内存中,还是根据需要从网络中获取? – 2010-09-30 17:12:13
@John解析XML。谢谢! – slowman21 2010-09-30 20:08:58