There are a few issues with getting this up and running in iOS 8.3:
[ ] 1. The segfault as pointed out in #28. Temporary fix is to not export the offending classes.
[ ] 2. I get the following error for almost every class (any class that defines a custom init method):
ERROR: Class UIViewController exported more than one init family method via JSExport. Class UIViewController will not have a callable JavaScript constructor function.
Passing 'void (^const _strong)()' to parameter of incompatible type 'JSValue *'
It would be awesome to get this up and running on iOS 8, I'm happy to do the work but I'm just getting my head around it right now.
Do you have any idea what the cause of 1 is and why is just happens for a small set of classes?
Regarding 2, one idea I had is to replace -(instancetype)initWithX: in protocols with a factory method like +(instancetype)createWithX:. For example UIView's protocol could have the method +(instancetype)createWithFrame:(CGRect)frame and UIView+JavaScriptBridge could have:
Hi there,
Really great project :smile:
There are a few issues with getting this up and running in iOS 8.3:
init
method):It would be awesome to get this up and running on iOS 8, I'm happy to do the work but I'm just getting my head around it right now.
Do you have any idea what the cause of 1 is and why is just happens for a small set of classes?
Regarding 2, one idea I had is to replace
-(instancetype)initWithX:
in protocols with a factory method like+(instancetype)createWithX:
. For example UIView's protocol could have the method+(instancetype)createWithFrame:(CGRect)frame
andUIView+JavaScriptBridge
could have:What do you think of this approach? Is there an automatic way to produce the framework headers so this wouldn't all have to be done manually?
I think 3 shouldn't be a big deal.