UIBarButtonItem UIBarButtonSystemItemUndo
UIBarButtonSystemItem
Defines system-supplied images for bar button items.
typedef enum {
UIBarButtonSystemItemDone,
UIBarButtonSystemItemCancel,
UIBarButtonSystemItemEdit,
UIBarButtonSystemItemSave,
UIBarButtonSystemItemAdd,
UIBarButtonSystemItemFlexibleSpace,
UIBarButtonSystemItemFixedSpace,
UIBarButtonSystemItemCompose,
UIBarButtonSystemItemReply,
UIBarButtonSystemItemAction,
UIBarButtonSystemItemOrganize,
UIBarButtonSystemItemBookmarks,
UIBarButtonSystemItemSearch,
UIBarButtonSystemItemRefresh,
UIBarButtonSystemItemStop,
UIBarButtonSystemItemCamera,
UIBarButtonSystemItemTrash,
UIBarButtonSystemItemPlay,
UIBarButtonSystemItemPause,
UIBarButtonSystemItemRewind,
UIBarButtonSystemItemFastForward,
UIBarButtonSystemItemUndo, // iOS 3.0 and later
UIBarButtonSystemItemRedo, // iOS 3.0 and later
UIBarButtonSystemItemPageCurl, // iOS 4.0 and later
} UIBarButtonSystemItem;
UIBarButtonItem UIBarButtonSystemItemUndo example.
- (void)viewDidLoad {
//Title
self.title = @"Advanced Search";
[super viewDidLoad];
//undo button takes you back to main search options
UIBarButtonItem *undoButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemUndo target:self action:@selector(undoButton:)];
self.navigationItem.leftBarButtonItem = undoButton;
}
- (void)undoButton:sender {
RootViewController *rootViewController = [[RootViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
[[self navigationController] presentModalViewController:navigationController animated:YES];
[navigationController release];
}
//Title
self.title = @"Advanced Search";
[super viewDidLoad];
//undo button takes you back to main search options
UIBarButtonItem *undoButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemUndo target:self action:@selector(undoButton:)];
self.navigationItem.leftBarButtonItem = undoButton;
}
- (void)undoButton:sender {
RootViewController *rootViewController = [[RootViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
[[self navigationController] presentModalViewController:navigationController animated:YES];
[navigationController release];
}
Example of [UIBarButtonItem UIBarButtonSystemItemUndo].
UIBarButtonItem *newUndoButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemUndo target:self action:@selector(addToFav)];