menuView= [[UIImageView alloc] initWithFrame:CGRectMake(0,411, 320,49)];
UIButton *test = [UIButton buttonWithType:UIButtonTypeCustom ];
test.frame = CGRectMake(0, 0, 80, 49);
[test addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[menuView addSubview:test];
[self.view addSubview:menuView];
I touch up inside (test ) button. but is not working . why??
Maybe you mixed
buttonPressed:withbuttonPressed.If you implement a method like
You need use
Note: Pay attention on the colon.
But depending on what you have done, you need implement a method like