I have a UIBarButtonItem
item in a xib file. I can set its identifier as play, pause, page curl etc in the xib file. Now how can I do that programmatically?
this should work (in viewDidLoad)
UIBarButtonItem *barButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:systemItem target:tar action:act] autorelease];
self.navigationItem.rightBarButton = barButtonItem;
where systemItem is the UIBarButtonSystemItem
type you want to use. full list of options here