FXGen failed to import methods with "keyword" in method name

I’m usin FXGen to import header from an Object-C library, and it failed at methods whose name happen to be c# keywords. (which compiled fine in Xcode)

+ (instancetype)return:(id)value;

I’ve no idea why it’s even legal for objective-c, but the fact is that it just compiled fine in xcode.
I managed to make the import process continue by rename the method in header file, but I’m quite sure that might cause problems in later stage.
So I wonder if it’s possible to customize FXGen import process to manually mapping problematic methods like above one.

Thanks, logged as bugs://66783: FXGen failed to import methods with “keyword” in method name

Ah got it. Try this updated crossbox zip: https://dl.dropboxusercontent.com/u/29927944/CrossBox.zip

Thanks ck.
It’s almost there.
Now method like

+ (instancetype)return:(id)value;

works.

But it still failed on:

- (RACSignal *)rac_signalForSelector:(SEL)selector fromProtocol:(Protocol *)protocol;

Error message:

An error occurred: ReactiveCocoa/NSObject+RACSelectorSignal.h (77:66 pp: 9708): Name Protocol COULD NOT BE FOUND: Protocol

Change parameter type from Protocol to id make the error goes away.

THat’s kind of weird. “Protocol” should be a standard thing. I’ll investigate. You can use this “id” workaround for now?

can you mail the full file (or where I cna find it) and tell me options you use in the fx importer?

Hi Carlo, here you can download Headers and Library ( or you can build from https://github.com/ReactiveCocoa/ReactiveCocoa )

And my FXGen options:

Thanks, logged as bugs://66837: FXGen failed to import methods with “keyword” in method name

just tried to import this with the latest build on Windows:

import -a x86_64  -i "C:\Projects\ReactiveCocoa\ReactiveCocoaFramework\ReactiveCocoa\extobjc" -x "C:\Program Files (x86)\RemObjects Software\Oxygene\Nougat\SDKs\OS X 10.9" -i C:\Projects\ReactiveCocoa\ReactiveCocoaFramework -c Reactive -z ReactiveCocoa/ReactiveCocoa.h -o c:\projects

And I got a nice Reactive.fx out of it:

Reactive.zip (84.7 KB)

latest build? Is 7.0.71.1477 the latest build.

I tried running HeaderImporter.exe with your options, and get the same error I ran into earlier on Mac (before your last update).

It failed on this:

+ (instancetype)return:(id)value;

which has been solved by your updated crossbox on Mac.

sorry I meant the latest internal build (should be next fridays beta). Thing is that I wasn’t able to reproduce your earlier error with the Protocol* reference with that, but I didn’t fix anything related to it.

Thanks carlo! Glad to hear that it works in latest internal build no matter what ( sometimes you just accept the happy incidence) :smiley:

btw, id* workaround works for me so far.

Found two more words that FXGen not happy with:

RETURN
ERROR

eg.

@property (nonatomic, readonly) id RETURN;
@property (nonatomic, readonly) id ERROR;

Notice that both word are capitalized, if change any char to lower case, then it’s ok.

I found what the issue with Protocol* was. It was there on OSX (where I tested it) but not on iOS, so after some research I found that iOS doesn’t define the Protocol class at all, only a forward, which isn’t registered because it’s a forward.

Oke thats a tricky one, arpa/ftp.h defines:

#define ERROR        5    /* permanent negative completion */

(And there’s another one that defines RETURN)

Oke, logged a bug bugs://66966: hi: allow undefining a define from a foreign fx

This will let you pass a list of defines you don’t want, like if there was a #undef at the top of all files.