I found recently that webkit model will be unsupported by Apple in Lion and Safari last release and that everybody is migrating to Firebreath project in order to use NPAPI.
I have a basic Cocoa Application which links with the following native frameworks:
- CoreGraphics
- CoreData
- IOKit
- PFEventTaps ( this is a 3 party framework by: Pfiddlesoft.com)
I've never used PlugIns so this is a little new for me, I started with the MAC tutorial written by Richard bateman and after following the guidelines I ends up with a firebreath project template for my personal project. the next step I made was just puting all my Objective-C classes into the Source Files folder adding the linking with the 4 frameworks, finally I added the new public methods I need to expose in the plug-In into the MyProjectPluinApi.h e.g.( registerMethod("MyMethod", make_method(this, &WilmerPlugInAPI::MyMethod ));
When I build the firebreath project I get a lot of compile errors, one of them very repetitive is:
NSString was not declared in this scope.
The error points to NSObjCRuntime.h
Until now I can't get this build succesfully with XCODE 3.2.6
what is wrong here? I need to change all my code to accomplish the CPP style in this template project? Or I can link my frameworks in some way? Is there some sample I can see?
MORE DETAILS: Nov 7 2011: I was trying to test with a simple project:
- First I create the project testOfFB
- it is generated in /users/Me/Firebreath-dev/build/projects/testofFB
- then I modify the class testFBApi.cpp and rename it to testFBApi.mm.
- I wrote an Objective-c class named testMath.m and rename it to testMath.mm
I add a method Add with the signature:
-(long) Add:(long)a:(long)b:(long)c;
Finally I modify the file testFBApi.mm with this:
registerMethod("add", make_method(this, &testFBAPI::add ));
In the implementation of add method I create an instance of the objective-c class method "add" to test the calling to my objective-c method. I did the includes and I changed the file /Mac/projectDef.cmake in this way:
target_link_libraries(${PROJECT_NAME} ${PLUGIN_INTERNAL_DEPS} ${Cocoa.framework} // added line ${Foundation.framework} //added line )
I run the prepmac.sh script and then build the xcode solution and same errors appear plus some others like testFBApi has not been declared.