简体   繁体   中英

Can Cocoa be used in FileMaker Plugins?

I am trying to port a Windows FileMaker plugin to OS X and am thinking that I should be doing this in Cocoa not Carbon,

but I am struggling to get anything to compile as soon as I include Cocoa.h

Are you importing it into a .c file? Cocoa requires Objective-C, so you'll need to rename any files you want to import its header into from .c to .m.

Of course, how practical that is depends on FileMaker's plug-in API on the Mac (assuming it has one). If the API, including UI hooks, is entirely Carbon-based, switching the plug-in's source to Cocoa may be futile. I can't say for sure without knowing that API.

Actually the FileMaker Framework is C++. You can mix C++ and Objective-C code so you could use Cocoa instead of Carbon. Beware that the file would be .mm not .m

An Objective-C wrapper to the C++ framework would make it possible to use .m Objective-C. Unfortunately I'm totally ignorant of C++ (and expect to stay) so it is beyond my competence.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM