开发者

UIBarButtonItem ignoring just about every action, ever

开发者 https://www.devze.com 2023-01-08 04:51 出处:网络
I have a toolbar, in which is placed a UIBarButtonItem. The selector is targeted at a custom view of mine; a method 开发者_高级运维with this signature:

I have a toolbar, in which is placed a UIBarButtonItem. The selector is targeted at a custom view of mine; a method 开发者_高级运维with this signature:

-(IBAction)pop{code}

However, clicking it does not cause any action to occur. The buttonitem doesn't appear to respond to the click either, it just stays gray.

Linking a UIButton's TouchUpInside event to the pop method is fine, it operates the method and displays the popover. But as soon as I connect the BarButtonItem's selector to it instead, it stops responding.


Make sure the selector has no colon after it - @selector(pop). If you use @selector(pop:) it expects a (void)pop:(id)sender { ... } function.

0

精彩评论

暂无评论...
验证码 换一张
取 消