Through Interface Builder I have the ability to change the Identifier of a UIBarButtonItem to something like "Add" (or "Undo", "Redo" etc...). This gives my button a nice "+" image.
How can I set this programatically? The UIBarButtonItem does not accept a "setIdentifier" message.
Once constructed, a UIBarButtonItem's "Identifier" can not be modified. However, the UI can be changed by replacing the button with a programmatically constructed variant. For example:
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(doAddAction:)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With