ABPeoplePickerProblems
ABPeoplePickerProblems
- Subject: ABPeoplePickerProblems
- From: "ronald b. kopelman" <email@hidden>
- Date: Tue, 09 Nov 2010 23:50:07 -0500
I am having a problem with the ABPeoplePickerView. I have read the Class Reference, the Address Book Programming Guide for Mac OS X, & searched the web, all to no avail. I wish to double click either a name or a group & have the program respond to the double click. I created an ABPeoplePickerView in IB & set up selectors in applicationDidFinishLaunching method using the setGroupDoubleAction & setNameDoubleAction. Double clicking a name works flawlessly but every time I try to double click the group it generates a "Controller cannot be nil" error.
Here is the peculiar part. If I set the "Allows Multiple Selection" property in IB, same result if I select only 1 group. However, if I select multiple groups, it works fine!? Whether or not the "Allows Multiple Selection" property is set, if I click on the "column titles" everything works fine.
I cannot understand this behavior. Nor can I understand why the error. Can anyone point me in the direction of some relevant literature or shed some light on this? I don't think it is my coding. All I want to do is double click a name or a group & send it on for further processing. Oh, I am running 10.6.4 on a mac book pro. Thanks for any insights you can offer. Code looks like this:
#import "AbeAppDelegate.h"
@implementation AbeAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[pickerView setGroupDoubleAction:@selector(doGroupDoubleAction)];
[pickerView setNameDoubleAction:@selector(doNameDoubleAction)];
[infoView insertText:@"applicationDidFinishLaunching:\r\r"];
}
// NSApplicationDelegate Protocol Reference to make red button kill app.
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication {return YES;}
- (void)doGroupDoubleAction
{
[infoView insertText:@"\r\rGroup was double clicked!\r\r"];
[infoView insertText:[[pickerView selectedGroups] description]];
[infoView insertText:@"\r\r"];
[infoView insertText:[[pickerView selectedRecords] description]];
[infoView insertText:@"\r\r"];
}
- (void)doNameDoubleAction
{
[infoView insertText:@"\r\rName was double clicked!\r\r"];
[infoView insertText:[[pickerView selectedRecords] description]];
[infoView insertText:@"\r\r"];
[infoView insertText:[[pickerView selectedGroups] description]];
[infoView insertText:@"\r\r"];
}
@end
ronald b. kopelman_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden