Change (not init) a UIBarButtonItem identifier programatically?

Posted by Nebs on Stack Overflow See other posts from Stack Overflow or by Nebs
Published on 2010-06-16T15:06:10Z Indexed on 2010/06/16 16:32 UTC
Read the original article Hit count: 583

In IB I can set the identifier of a UIBarButtonItem to 'play' which adds an image of a play button (right-pointing triangle).

Is there a way to change this image programatically? I want to change it to 'pause' when the play button is pressed.

I know you can initialize a UIBarButtonItem with an identifier but I've yet to find a way to change it after it's been initialized. Is this even possible?

The only thing I can think of is to remove the old button and initialize a new one in its place, but this hardly seems efficient.

Any thoughts?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk