Я думаю, что сам код достаточно ясен, если вы просто распакуете все вызовы методов, чтобы увидеть подразумеваемую вложенность различных объектов. Комментарии:
// if the current object's tableDataSource property has not been defined yet
if (!self.tableDataSource) {
// then define it.
// Set it to be an NSArray initialized by reading ...
self.tableDataSource = [NSArray arrayWithContentsOfFile:
// ... the plist file MenuData.plist found within the application's bundle
[[NSBundle mainBundle] pathForResource: @"MenuData" ofType: @"plist"]];
// and also set the current object's property nagitationItem.title to "Menu"
self.navigationItem.title = @"Menu";
}
// Now create a dictionary
// Get this dictionary by ...
// going to the element numbered indexPath.section in the tableDataSource
NSDictionary *dictionary = [[[self.tableDataSource objectAtIndex: indexPath.section]
// (assume that element is an NSDictionary)
// get that element's value stored witht the key "Children"
objectForKey: @"Children"]
// (assume that retrieved value is an NSArray)
// then get the element numbered indexPath.row from that array
objectAtIndex: indexPath.row];
// expect that value to be an NSDictionary
Я думаю, что документы Apple на TableDataSource , вероятно, дадут вам более широкий контекст того, что делает этот код. В частности, вложение словаря, в массив, словарь, массив, что происходит в последней строке, может быть стандартным способом кодирования всей информации для строк, столбцов и т. Д., Для данные управляют UITableView.