When a user views the detail for a post that contains a video, I’d like to show a ‘play’ icon overlaying the post thumbnail.
I’ve tried this but it doesn’t compile:
if ([postType isEqualToString:@"video"]) {
UIImageView *videoIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vicon"]];
videoIcon.frame = CGRectMake(5, 10, 35, 35);
[self addSubview:videoIcon];
}
and the error given is:
No visible @interface declares the selector addSubview
Does anyone know how to make this work?
The above code is within my DetailViewController.m. The overall structure is that of a UICollectionView with Master/Detail interfaces.
Perhaps
if
selfis not a subclass ofUIViewthenaddSubviewis unlikely to be defined