Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-29-2009, 05:29 PM   #1 (permalink)
mr-sk
.38 special tucked
 
Join Date: Apr 2009
Location: Brooklyn, NY
Posts: 133
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
 

» Advertisements
» Stats
Members: 158,690
Threads: 89,164
Posts: 380,414
Top Poster: BrianSlick (7,110)
Welcome to our newest member, hudsonas4
Powered by vBadvanced CMPS v3.1.0

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