views:

49

answers:

1

I'm taking my first steps toward learning to write desktop code for the Mac and, thinking it would be a baby step, I decided to write an Address Book plugin to "fix" something that's annoyed me for a long time. Embarrassingly, I can't even get the boilerplate plugin to work the way I think it's supposed to work.

My understanding from the Programming Guide is that creating a new Address Book Action Plugin actually creates a simple, but functional, plugin. If I create a build and copy the bundle to ~/Library/Address Book Plug-Ins/, I should be able to open Address Book and see a custom context menu item when right-clicking on a phone number. I don't see that.

I'm brand new to the entire Mac development ecosystem. I've never used XCode, never written any Objective-C, never worked within the Cocoa framework. It's entirely possible--maybe probable--that I'm missing the most obvious of answers because I simply don't know what I'm looking for. Unfortunately, there's quite the dearth of beginner tutorials on these things. The programming guide itself isn't particularly beginner-friendly.

Any guidance would be much appreciated.

A: 

Sounds like a 32/64 bit problem.

Find the Target in Xcode's sidebar that represents your plugin bundle. Click on it, then click Info in the toolbar. On the Build tab of the info window, you should find Architectures: change that to "64 bit intel".

Amorya
I had considered that based on extrapolation from something else I'd read. I changed the architecture from the default 32-bit to "Standard (32/64-bit Universal)". That didn't work. I did try the "64-bit Intel" option on your suggestion, but the result is no different, unfortunately.
Rob Wilkerson
Odd. I tested it myself before posting my comment. New plugin on latest non-beta Xcode, latest Snow Leopard. Made new project with the address book template, chose Build, found the product (the .bundle), and copied it into the directory you mentioned. Didn't work. Changed just the architecture (to 64 bit), built again, re-copied, and then I had a Speak item appear when I click on a phone number in address book. (For the record, it appears when left clicking on the label (work, home etc), not when right clicking on the number itself.)
Amorya
Well, shit. That's at least part of the problem. I read/hear "context menu" and I assume a right-click. I can see other plugins appear on left click, so I'll check on this as soon as I get home. Maybe that's the answer. Thanks.
Rob Wilkerson
I'll double check that the architecture mattered, but sure as hell my expectations/assumptions were wrong. Thanks for your help.
Rob Wilkerson