У меня есть класс UserData, который я импортировал в этот viewcontroller, но данные в ячейке пустые.И снова userdata - это объект UserData, другого класса.Я сделал #import "UserData.h"
, но таблица будет пустой, если я добавлю @ "что-то" вместо строки сведений или строки заголовка, она появится в таблице
- (void)viewDidLoad
{
detailsstring = userdata.details;
titlestring = userdata.title;
tabledata = [[NSMutableArray alloc] initWithObjects:detailsstring, nil];
tablesubtitles = [[NSMutableArray alloc] initWithObjects:titlestring, nil];
[super viewDidLoad];
}
и ...
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
UITableViewCell *cell = nil;
cell = [tableView dequeueReusableCellWithIdentifier:@"homeworkcell"];
if(cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"homeworkcell"];
}
cell.textLabel.text = [tabledata objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [tablesubtitles objectAtIndex:indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:14.0];