-2
// Close
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:[[I18n sharedInstance] cancelButton]
style:UIBarButtonSystemItemCancel
target:self
action:@selector(dismissSignatureView:)];
[self.navigationItem setLeftBarButtonItem:closeButton];
[closeButton release];
// Close Button
UIBarButtonItem *eraseButton = [[UIBarButtonItem alloc] initWithTitle:@"Clear"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(eraseSignature:)];
[self.navigationItem setLeftBarButtonItem:eraseButton];
[eraseButton release];
// Close and Save
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:[[I18n sharedInstance] okButton]
style:UIBarButtonItemStyleBordered
target:self
action:@selector(dismissSignatureViewAndSelect:)];
doneButton.tag = fieldTag;
[self.navigationItem setRightBarButtonItem:doneButton];
[doneButton release];
[self.signatureSheet.navigationBarView setItems:[NSArray arrayWithObjects:closeButton, eraseButton, doneButton, nil]];
[self.signatureSheet viewWillAppear:NO];
? – 2015-03-03 07:28:28
爲什麼在使用之前釋放?並設置左鍵兩次將取代。所以一個按鈕在使用之前會被銷燬...... – Wain 2015-03-03 07:36:31