У меня есть customTableViewCell
, что я пытаюсь установить изображение и некоторый текст. Ячейка создана успешно, но свойствами являются nil
. Я не уверен, есть ли что-то, чего я не вижу в .xib
, но я просто не могу понять это. Розетки устанавливаются в .h
в customViewCell
и подключены в .xib
Свойства CustomTableViewCell не установлены (они ноль)
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"socialMediaCell";
CustomSocialMediaTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
CustomSocialMediaTableViewCell *tagCell = (CustomSocialMediaTableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"socialMediaCell"];
if (cell == nil) {
cell = [[CustomSocialMediaTableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
tagCell = [[CustomSocialMediaTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
NSData* imageData = [[NSUserDefaults standardUserDefaults] objectForKey:@"socialPosts"];
UIImage* image = [UIImage imageWithData:imageData];
cell.socialMediaTextView.text = @"TEXT";
cell.socialMediaImageView.image = image;
return cell;
}
макияж убедитесь, что ваши магазины @Property .. –
, пожалуйста, исправьте формат кода в вопросе ... –
cellIdentifier = @ "socialMediaCell" ИЛИ cellIdentifier = @ "CustomSocialMediaTableViewCell"? –