我想在导航栏中添加一个分享按钮的动作,但是我不知道如何定义我的“shareAction”方法以及在哪里定义它。为了添加分享按钮,我在viewWillAppear中有以下代码:
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(shareAction:)];
self.navigationItem.rightBarButtonItem = shareButton;