Heya, I've been struggling with an extremely annoying problem for many hours now and I decided that I'd better ask for help. I've tried to google my problem and found a couple of similar threads but nothing that gave an answer that helped me.
Here goes:
In my viewcontrollers main view i have a scollview which contains a couple of subview. One of these subview have a UIButton in it which when clicked adds another subview to its superview. This newly added view contains a UIButton(that will be used to remove the added view), this button is my problem, it doesn't respond to touch-events at all...
code:
Code:
subview = [[UIView alloc] initWithFrame:frame];
[viewAddedInIB addSubview:subView];
UIButton *removeButton = [UIButton ButtonWithType:UIButtonTypeCustom];
[removeButton setFrame:buttonFrame];
[removeButton setBackgroundImage:[UIImage imageNamed:@"remove.png"]];
[removeButton addTarget:self action:@selector(onPress:) forControlEvents:UIControlEventTouchUpInside];
[subView addSubview:removeButton];