I have created a custom button and I want it to act like the editButtonItem. I do not know how to do this. The code below is what I am using. All of my custom buttons are showing up but I do not know what I should use in the @selector(...?..
I want my custom editButton to work like the default editButton
subclassed so I can have three buttons on navigation bar
Hi Brian,
Thanks for the reply.
Because I am creating a subview toolBar in the rightBarButtonItem I can not seem to get the edit button to work there. If I simply use the self.navigationItem.rightBarButtonItem = self.editButtonItem it works but I do not know how to create that editButtonItem in the subview I guess...
I am trying to have three buttons in the navigation bar. Back, add and edit. The back and add buttons are working as expected and the edit button shows up but does not do anything.
Quote:
Originally Posted by BrianSlick
Just use the editButtonItem. As noted in the documentation, it calls setEditing:animated:
Last edited by aldcorn@live.com; 10-12-2010 at 11:47 AM.
Thanks for your help Brian.
For anyone following this thread the solution for me was to simply rename my editButton to editButtonItem in all spots. Everything appears to be working as expected now.
Take care,
Rob
Quote:
Originally Posted by BrianSlick
Just use the editButtonItem. As noted in the documentation, it calls setEditing:animated:
Hi,
To follow this process I am now successfully getting the EDIT mode but my EDIT button is not changing to DONE during the editing process. How do I go about resolving this?
Are you suggesting that I avoid the use of this toolBar subView?
You are correct that I know how to get the editButtonItem to work when it is the rightBarButtonItem but When I add another button into the rightBarButtonItem as subviews I don't know how to add THE editButtonItem.
I can understand your frustration here and I appreciate your help.
Posting portions of a line of code is not useful. Post the entire line if you're going to post something.
But yes, autoreleasing the button would avoid the leak.
I am trying to do something similar. Following is my problem, can someone please help
I have added uitoolbar in uinavigationcontroller using IB (by selecting the check box - "show toolbar"). I used IB since this was easy to add flexible spacing bar buttons (I did not want to deal with spacing code programmatically). My issue is that I want to invoke the built-in edit and add functionality for the 2 toolbar buttons I added. I know that in the navigation bar I can use the following code and it will invoke this functionality
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemA dd target:self action:nil];
Above code takes care of the "Edit view", where the table view items are shown with a delete button next to them.
How can I achieve the same for the buttons that I added to the toolbar? I am using Xcode 4. Please point me to some code examples.