我有麻煩設置我的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