I need to display UIImageView when target name matched. I have used below code, but the imageview getting displayed so many items and it keep getting images and displaying. Please find the attached image
int targetIndex = 0;
if (!strcmp(trackable.getName(), "focusbrain"))
targetIndex = 1;
else if (!strcmp(trackable.getName(), "tarmac"))
targetIndex = 2;
if(trackable.getName(), "focusbrain"){
[self performSelectorOnMainThread:@selector(displayimage
) withObject:nil waitUntilDone:false];
}
-(void)displayimage{
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 200, 500, 500)];
imgView.image = [UIImage imageNamed:@"brain.jpg"];
[imgView setUserInteractionEnabled:YES];
[self addSubview: imgView];
}