I want to add an event to an image. but if i add this means it will gives the warning: UIImage maynot respond to addtarget action for control events. how can i correct this code.
this is my code UIImageView *image;
UIImage *image1=[UIImage imageNamed:@"left_arrow.png"]; image=[[UIImageView alloc]initWithImage:image1]; image.frame=CGRectMake(100,410,30,30);
[image1 addTarget:self action:@selector(buttonPressed2:)forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:image];