I have NSMutableDictionary that I'm retrieving text from. I"m trying to display this text into a tableview cell along with some other text that I want added with it. Here's my non-working code:
[[cell name] setText:(@"Name:%@",[NameDict valueForKey:@"name"])];
I've even tried stringWithFormat and still can't get it to work. I can't get the Name: part to display into the cell along with NameDict value for that key. 开发者_如何学运维Any ideas what I'm doing wrong here? Thanks.
I'm not sure where you are getting [cell name]
from, but this would be a better solution for you based on your code:
[[cell name] setText:[NSString stringWithFormat:@"Name:%@",[NameDict objectForKey:@"name"]]];
If you are trying to place that text as the cell text, use:
cell.textLabel.text = [NSString stringWithFormat:@"Name:%@",[NameDict objectForKey:@"name"]];
精彩评论