Toolbars buttons are not working when I am adding Toolbar on picker view. It's working in iOS 6 but not in iOS 7.
UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0 ,0, 320, 44)];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(handleDone)];
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(handleCancel)];
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self
action:nil];
[toolBar setItems:[NSArray arrayWithObjects:cancelButton, flexible, doneButton, nil] animated:YES];
[pikerView addSubview:toolBar];