Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-29-2009, 04:29 PM   #1 (permalink)
mr-sk
.38 special tucked
iPhone Dev SDK Supporter
 
Join Date: Apr 2009
Location: Brooklyn, NY
Posts: 132
Default Changing UIBarButtonItem Identifier programatically

Hello,

So, I've searched around and looked through the class reference, but I cannot find the answer. I'm trying to change a UIBarButtonItem's Identifier, from 'Add' (+) to Undo once selected.

Code:
- (IBAction)addToFav:(id)sender
{    
    NSLog(@"Add Button Pressed");    
    addButton.enabled = FALSE;
    //addButton.style = UIBarButtonSystemItemUndo;
    UIBarButtonItem *newUndoButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemUndo target:self action:@selector(id)];
    self.navigationItem.rightBarButtonItem = newUndoButton;
Disabling the button works fine, but what I really want to do is replace it with a Undo button. The above code doesn't work ...

How should I do this?

Thanks in advance -
- sk
mr-sk is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,358
Threads: 39,155
Posts: 171,643
Top Poster: smasher (2,577)
Welcome to our newest member, jeffry7robbins
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:53 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.