Skip to content

Instantly share code, notes, and snippets.

@dima767
Created February 10, 2010 00:56
Show Gist options
  • Save dima767/299885 to your computer and use it in GitHub Desktop.
Save dima767/299885 to your computer and use it in GitHub Desktop.
UIBarButtonItem * CreateAutoReleasedButtonWithTitle_Target_Action(NSString *title, id target, SEL actionSelector) {
return [[[UIBarButtonItem alloc] initWithTitle:title
style:UIBarButtonItemStyleBordered
target:target
action:actionSelector] autorelease];
}
UIBarButtonItem * CreateAutoReleasedButtonWithTitle(NSString *title) {
return CreateAutoReleasedButtonWithTitle_Target_Action(title, nil, nil);
}
UIBarButtonItem * CreateAutoReleasedFlexibleSpaceButton() {
return [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil] autorelease];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment