我怎麼可以在NSTableView
使用Cocoa使用NSMutableArray
NSMutableDictionary's
?任何人都可以提出適當的解決方案嗎?NSDictionary內容NSTableView
0
A
回答
0
請看下面的例子:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// I will use tempDict Object for your understandings, otherwise it can be used directly. Here array1 is Main DataSource for UITableView.
NSDictionary *tempDict = [array1 objectAtIndex:indexPath.row];
// key1 is the key to get the object from the dictionary.
cell.title.text = [tempDict valueForKey:key1];
return cell;
}
這裏,陣列1是你的表視圖,其中包含NSDictionary
對象主要DataSource
。
希望這會有所幫助。
+0
謝謝你。它真的幫了我很多:) – Preethi
+0
如果它解決了你的問題,請點擊答案旁邊的複選標記輪廓。 – paulmelnikow
相關問題
- 1. NSTableView內容視圖插圖
- 2. 訪問的NSDictionary內容
- 3. 的NSDictionary內的NSDictionary
- 4. 獲取NSTableView中內容的高度
- 5. 控制粘貼到NSTableView中的內容
- 6. NSTableView的內容不被刷新正確
- 7. NSTableView的顯示不NSMutableArray的內容
- 8. 用NSMutableDictionary的修改內容刷新NSTableView
- 9. 一個NSDictionary中的內容複製到另一個NSDictionary的
- 10. 初始化和訪問NSDictionary的內容
- 11. 處理從Flickr解析的NSDictionary內容
- 12. 使用NSDictionary內容創建一個NSManagedObject
- 13. 如何檢索NSDictionary的所有內容?
- 14. 在NSDictionary中提取nodeChildArray的內容
- 15. NSArray內的NSDictionary
- 16. NSArray內的NSDictionary
- 17. 修改內容後發生NSDictionary內存泄漏
- 18. 可可綁定在NSTableView中顯示NSDictionary鍵
- 19. 如何從NSDictionary將數據綁定到NSTableView?
- 20. 例外內的NSDictionary
- 21. NSDictionary泄漏內存
- 22. NSDictionary內存泄漏
- 23. NSTableView reloadData泄漏內存
- 24. 在編輯之前更改NSTableView中的單元格內容
- 25. NSTableView不滾動,而是下推內容低於
- 26. 如何在nstableview reloaddata之後保持可見內容?
- 27. 基於視圖的NSTableView的,讓行高度依賴於內容
- 28. 如何在NSTableView中保存行的編輯內容?
- 29. 在Swift中基於視圖的NSTableView不顯示內容
- 30. 如何根據文本內容增加NSTableView中的行高?
http://stackoverflow.com/questions/4081632/how-to-bind-data-to-a-nstableview-from-a-nsdictionary – iPatel
你打算使用綁定還是編碼? –
換句話說,Cocoa Bindings或者編寫自己的控制器代碼? – paulmelnikow