Hi,
Can anyone please guide me on the right process on calling a method when a UIToolbar item is clicked?
Here's my code:
UIButton *cstCommunications = [[UIButton alloc] init]; [cstCommunications setTitle:@"Communications" forState:UIControlStateNormal];
cstCommunications.backgroundColor = [UIColor redColor];
[cstCommunications setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
cstCommunications.titleLabel.font = [UIFont systemFontOfSize:10.0f];
[cstCommunications setFrame:CGRectMake(0.0f, 0.0f, 80.0f, 15.0f)];
UIBarButtonItem *btnCommunications = [[UIBarButtonItem alloc] initWithCustomView:cstCommunications];
btnCommunications.action = @selector(testAction

;
btnCommunications.target = self;
But when i click on the tool bar item, the code does not go to testAction method...Am I missing something here? Any help would be greatly appreciated. Thanks again.