У меня есть проблема с моей пользовательской ячейкой tableview. Когда я хочу поместить текст на свои ярлыки, это не изменится. Вот как выглядит мой код.Пользовательский UITableviewCell не устанавливает метку
мой NieuwsTableViewCell.h
@interface NieuwsTableViewCell : UITableViewCell{
}
@property (nonatomic, retain) IBOutlet UILabel *topic;
@property (nonatomic, retain) IBOutlet UILabel *omschrijving;
@end
мой NieuwsTAbleViewCell.m
@implementation NieuwsTableViewCell
@synthesize topic;
@synthesize omschrijving;
и мой firstViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NieuwsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"NieuwsTableViewCell" owner:nil options:nil];
for (UIView *view in views) {
if([view isKindOfClass:[UITableViewCell class]])
{
NSDictionary *info = [json objectAtIndex:indexPath.row];
cell.topic.text = @"Stef";
cell.omschrijving.text = [info objectForKey:@"Nie_omschrijving"];
NSLog(@"voorlopige test");
cell = (NieuwsTableViewCell*)view;
}
}
}
return cell;
}
It Works! Спасибо ! – steaphann