我已经读过这个问题QLPreviewController remove or add UIBarButtonItems但这不是我要找的。我想在导航栏中保留“打印”按钮,但还要在导航栏中添加一个新的“删除文档”按钮。
我试过这个:
QLPreviewController *previewer = [[[QLPreviewController alloc] init] autorelease];
[previewer setDataSource:self];
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc]initWithTitle:@"Salva Documento" style:UIBarButtonItemStyleBordered target:self action:@selector(saveFileToDocuments)];
NSArray *buttons = [NSArray arrayWithObjects:[[previewer navigationItem]rightBarButtonItem],saveButton, nil];
[[previewer navigationItem]setRightBarButtonItems:buttons];
但它没有用。