Popular Posts

Jun 13, 2011

Make Button to nav Bar


- (void)viewDidLoad
{
         // Add our custom add button as the nav bar's custom right view
         UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"AddTitle", @"")
                                                                                                                                                                                       style:UIBarButtonItemStyleBordered
                                                                                                                                                                                      target:self
                                                                                                                                                                                      action:@selector(addAction:)] autorelease];
         self.navigationItem.rightBarButtonItem = addButton;
}

- (IBAction)addAction:(id)sender
{
         // The add button was clicked, handle it here
}

No comments:

Post a Comment