Thanks for the response. My code is below. I also submitted this problem to the Apple Developers forum and I got a response. You probably would have found it too if I had included the code below.
The Apple response said there were two problems one I had a tag variable defined in my CardImageView class. And I was in effect setting that tag variable instead of the view tag.
Also in my definition of the DispCard I should have use CardImageView instead of UIView. I told them I got an error or that and they gave me the following syntax to use and it all worked successfully.
CardImageView * DispCard;
DispCard = (CardImageView *)[self.view viewWithTag:(5)];
Thanks for your response. You probably would have found the same.
hugh
Code:
#import "CardImageView.h"
@implementation CardImageView
- (id)initWithFrame:(CGRect)frame CardBase:(NSString *)cardBase andTag:(int) inTag {
NSString * tImageName;
self = [super initWithFrame:frame];
if (self) {
self.tag = inTag;
self.userInteractionEnabled = YES;
tImageName = [NSString stringWithFormat:@"%@.png",cardBase];
self.image = [UIImage imageNamed:tImageName];
}
return self;
}
@end