I have a NSDictionary that holds the set of objects that will be used in an array to create as many as needed. I have a delete button in the upper right corner of the image and for some reason, I'm unable to click it. I'll write it out...
-(void)addItemsToSomething:(NSMutableArray*)array
{
for (NSDictionary *item in array) {
UIImageView *container....
UIImageView *boxInContainer....
UIButton *delete = [UIButton new];
delete.frame = CGRectMake(70, -4, 24, 26);
delete.userInteractionEnabled = YES;
[delete setBackgroundImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal];
[delete addTarget:self action:@selector(delete:) forControlEvents:UIControlEventTouchUpInside];
[boxInContainer addSubview:delete];
some math....
}
more math
}
-(void)delete:(id)sender
{
NSLog(@"Do I work");
}
The NSLog never shows in the logs nor does the button shadow to show it's been touched. I even set the userInteractionEnabled to YES just to try and cover another base but the button still stares me in the face and won't click. Thanks for the help.
This is all placed on a scrollview as well, forgot that part.