开发者

UIBarButtonItem ignoring just about every action, ever

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜