yuchi / hyperloop-macros

Sweet.js macros to accelerate Hyperloop development
GNU Lesser General Public License v2.1
6 stars 0 forks source link

Automatic arguments casting – Issues with pointers #6

Closed yuchi closed 10 years ago

yuchi commented 10 years ago

In the current example there’s an issue about automatic arguments casting. As you can see at line 37, we need to cast an argument defined as NSIndexPath * to NSIndexPath. This is unfortunate.

Invoking @infosia, @sophrinix or @jhaynie to give their idea on this. My obj-c-fu is not that good, is there a way to infer that the cast should happen to the concrete type instead of a pointer to it?

Sophrinix commented 10 years ago

If I asked you back your question but replaced obj-c with Objective-C++ does this help you?

is the README example suppose to compile, because I'm getting TypeError: Cannot read property 'methods' of undefined.

As for the example you reference, It's blowing up for me before I get the the issue you pointed out (pun not intended).

Error: couldn't find method: initWithFrame for class: UIWindow and 1 arg at ./Users_andrewmcelroy_Desktop_hyperloop_macros_examples_obj_c_tableViewController_app.js:105

yuchi commented 10 years ago

To test things in your environment you can 1) grunt to run unittest and 2) use following:

npm install --global sweet.js
cd hyperloop-macros/examples/obj-c/tableViewController
# compiling to js
sjs app.sjs --module ../../../obj-c -r > app.js
# launching hl
hyperloop clean compile package launch --platform=ios --arch=i386 --log-level=debug --src="." --debug
yuchi commented 10 years ago

And no, Objective-C++ does not help me any more :(

yuchi commented 10 years ago

Could you please pull the code of the example again? That error you saw was related to https://github.com/appcelerator/hyperloop-ios/issues/82

Could you please also confirm my inference:

An argument of the type X * can be .casted to X

yuchi commented 10 years ago

I feel stupid.