For some reason, my shouldPerformDefaultActionForPerson function never gets called, in the simulator and the device. Could someone look at this and tell me what I'm missing? From all the examples I've found, I can't see what I'm doing wrong.
Here is my header:
#import <Foundation/Foundation.h>
#import <AddressBookUI/AddressBookUI.h>
#import <MessageUI/MessageUI.h>
#import "SWO.h"
@interface CustomABPersonViewController : ABPersonViewController
<MFMessageComposeViewControllerDelegate, ABPersonViewControllerDelegate>
{
SWO *theSWO;
}
- (id)initWithSWO:(SWO *)aSWO;
@end
And here is my implementation file:
#import "CustomABPersonViewController.h"
#import <MessageUI/MessageUI.h>
#import "SWO.h"
@implementation CustomABPersonViewController
- (id)initWithSWO:(SWO *)aSWO
{
if (self = [super init])
{
//Various init code
}
return self;
}
- (BOOL)personViewController:(ABPersonViewController *)personView shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)IdentifierForValue
{
NSLog(@"In here!");
return YES;
}
@end
And here is when I call in the view:
CustomABPersonViewController *view = [[CustomABPersonViewController alloc] initWithSWO:aSWO];
view.personViewDelegate = self;
view.displayedPerson = aRecord;
[self.navigationController setToolbarHidden:NO animated:NO];
[self.navigationController pushViewController:view animated:YES];