【发布时间】:2016-02-13 07:54:54
【问题描述】:
现在我已经声明:
NSMutableArray *feeds;
NSMutableString* Severity;
NSMutableString* incidentNumber;
NSMutableDictionary *IncidentGetList;
我已经成功从 XMLParser 中检索出数据,日志中的数据是这样的:
Final Feed : (
{
code = 80180058;
Severity = Warning;
},
{
code = 80167359;
color = red;
},
{
code = 80143253;
color = green;
},
{
code = 80118575;
color = blue;
},
{
code = 80114765;
color = yellow;
}
)
问题是如何在 ONE CELL 中显示这两个可变字符串。这意味着表格视图中的每个单元格都显示代码:12345 和颜色:黄色。
下面是我在表格视图中的代码:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [feeds count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
cell.textLabel.text = [[feeds objectAtIndex:indexPath.row]objectForKey:@"color"];
cell.textLabel.text = [[feeds objectAtIndex:indexPath.row] objectForKey:@"code"];
return cell;
}
【问题讨论】:
-
你现在做了什么? 1 个标签:代码?
-
我无法将字典提要中的数据显示到表格视图中。
-
我的字典包含两个可变字符串严重性和事件编号。我希望两个字符串都显示在表格视图的一个单元格中
-
现在什么都没有显示?
标签: ios objective-c arrays dictionary tableview