"Buttons in navigation bar"

Sun 28 November 2010

 

- (id)initWithStyle:(UITableViewStyle)style {

    // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.

    if (self = [super initWithStyle:style]) {

UIBarButtonItem *doneBarButtonItem = [[UIBarButtonItem alloc] //init];

initWithTitle:@"Done"

style:UIBarButtonItemStyleBordered

target:self 

action:@selector(doneAction:)];

self.navigationItem.leftBarButtonItem = doneBarButtonItem;

[doneBarButtonItem release];

    }

    return self;

}

 

- (void)doneAction:(id)sender{

[[self navigationController] popViewControllerAnimated:YES];

}