Class Extensions (class helpers) from a static lib are not recognized in Oxygene

I have attached the headers + FX + .a of the source Library “MTDates”.
Yesterday I was able to successfully import the headers with FxGen.

I’ve added a reference to MTDates.fx my project.
The original class (helper) extends the classes NSDate and NSDateComponents.
In Oxygene are the Class Extensions not available.

var lDt := new NSDate;
     var lYear := lDt.mt_year / / << E44 No member “mt_year” on type NSDate

If you include the MTDates.a and original header “NSDate+MTDates.h” and “NSDateComponents+MTDates.h” in a Xcode project, then are the class extensions available there.

Am I doing something wrong or is there something special to consider?

it seems the problem is that all types are “without” a namespace, they’re all in the root. The compiler uses namespace to decide if a category type will be included, but that doesn’t work without a namespace. When importing you want to import them as

MTDates/file.h instead of passing the path to MTDates and file.h as a filename. Another option is using the --prefix option.

I will reimport the library today.
I’m sure it will work with your informations.
Thank you.

I have imported the MTDates headers now out of a subdirectory.
Now I can add the namespace “MTDates” to my uses clause and the class extensions for NSDate are available.

Thank you. This looks good so far.

Now I have an embarrassing question …

Do I need to prepare the MTDates header somehow?
A’la Delphi << function xyz: Boolean; CDECL; external “libMTDates.a” >> ?

In the Xcode finding the .a and the header files “somehow” automatically to each other. I can run my test project in the simulator or on my device.

The Oxygene project is starting and after build + deployment and terminates with an NSInvalidArgumentException.

An exception of type: NSException/NSInvalidArgumentException occurred
2013-06-25 19:27:41.929 UtilityApp2[7052:c07] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSDate mt_dayOfYear]: unrecognized selector sent to instance 0x718d870’

It looks as if the .a isn’t linked or deployed.
I added “MTDates” (without lib and .a) in FxGen unter “Libraries to link”.
FxGen completed successfully.

The .a exists next to the .fx files in the iOS and iOS Simulator folders.

I could not find further infos in the wiki about integrating static libs in Oxygene for Cocoa.

Can you tell me please, what I have to prepare, that my Nougat project did run with the external lib?

i’m thinking something goes wring linking this, because the .a ONLY has categories. we’ll investigate asap.