Я пытаюсь отобразить словарь plist в UITableView, я прочитал много вопросов и ответов здесь, но не повезло! кажется, клетки возвращают null! вот мой PLIST: Проблема с чтением Plist в UITableView
и мои коды:
-(void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@"feed" ofType:@"plist"];
newsFeed = [NSArray arrayWithContentsOfFile:path];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return newsFeed.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return dictionary.allKeys.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
dictionary = [newsFeed objectAtIndex:indexPath.section];
cell.textLabel.text = [[newsFeed objectAtIndex:indexPath.row] valueForKey:@"title"];
return cell;
}
и результат ничего:
Что значение в словаре? – Rajneesh071
@ Rajneesh071 NSDictionary * словарь; –
Я спрашиваю о значении, где вы устанавливаете значение в нем – Rajneesh071