UIBarButtonItem unclickable?

Your view controller's view is an UIImageView UIImageView's user interaction is disabled by default. So it disables the user interaction of all its subviews too (that's why the button doesn't respond to touches). You have to explicitly set.

Your view controller's view is an UIImageView. UIImageView's user interaction is disabled by default. So it disables the user interaction of all its subviews too (that's why the button doesn't respond to touches).

You have to explicitly set, backView. UserInteractionEnabled = YES.

Thank you, it fixed my problem. I could look for the solution a long time. – Maxime Capelle Oct 11 at 10:38 You are welcome!

;-) – EmptyStack Oct 11 at 10:41.

But just a wild guess, maybe you should change your code to ...action:@selector(onTouchBackButton:) autorelease; notice the presence of : this is needed as your IBAction takes an arg (id) sender.

Thank you for your comment, after I applied the fix from @EmptyStack, my app crashed because of the missing ":" – Maxime Capelle Oct 11 at 10:41.

Maxime Capelle, Try this code, UIImage* image = UIImage imageNamed:@"back. Png"; CGRect frame = CGRectMake(0, 0, image.size. Width, image.size.

Height); UIButton* backgbtn = UIButton alloc initWithFrame:frame; backgbtn setBackgroundImage:image forState:UIControlStateNormal; backgbtn setShowsTouchWhen backgbtn addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside; UIBarButtonItem* backBarButtonItem = UIBarButtonItem alloc initWithCustomView:backgbtn; self. NavigationItem setLeftBarButtonItem:backBarButtonItem; backBarButtonItem release; backgbtn release.

Maxime Capelle,write button action event -(IBAction)goBack{} – Prajan Oct 11 at 6:06.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions