views:

25

answers:

0

I have a table view , within that tableview I'm setting up a section header, which I want to contain an edit button. I know there is a built in support for something like that if my viewcontroller is part of a navigation chain, but is there a way to do it without it, or the only option is to set a button manualy and trigger an action that will replace the title and the editing property? btw - I know the code I wrote below is wrong, just wondering if there is a convenient way to convert a UIBarButtonItem to a UIButton. Thanks

-(UIView*) headerView
{
    if (headerView)
        return headerView;

    float w = [[UIScreen mainScreen] bounds].size.width;
    CGRect headerViewFrame = CGRectMake(0,0, w,48);
    headerView = [[UIView alloc] initWithFrame:headerViewFrame];

    [headerView addSubview:[self editButtonItem]]; // I want to do something like that
}