0

I added a button on a subview of my main view, and when i am pressing that button... I can see it pressed but its selector is not getting called. And when i keep pressing the button for long then its selector method gets called. If i dont add that button on the subview of main view ,then everything works fine. Can anyone tell where and what i am missing?

UIButton *btn =[UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn setFrame:CGRectMake(0, 0, 120, 30)];
[btn addTarget:self action:@selector(pickImage:) forControlEvents:UIControlEventTouchUpInside];
[btn setAutoresizingMask:  UIViewAutoresizingFlexibleRightMargin];    
[btnView addSubview:pickBtn];
[self.view addSubview:btnView];
Scar
  • 3,460
  • 3
  • 26
  • 51
Vishal Singh
  • 4,400
  • 4
  • 27
  • 43

0 Answers0