-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot call UIApplicationMain() internalFieldCount() > 0 assert #14
Comments
Oh I think I see. Yes, it's the |
Thanks! this code seems to work:
But I'm unable to pass a NSString on the 3rd/4th arguments. Is this code fine?
Output is:
For this :
i get
How are strings suposed to be passed here? |
Your first version should work: var str = $.NSString('stringWithUTF8String', "hello world")
$.UIApplicationMain(0, ffi.Pointer.NULL, str, null); Note that the assertion error is coming from within Try running |
gdb didnt stops on the assert. i tried placing a breakpoing on the symbol, but steping takes forever.. would be better to have a simpler test case for this i think. btw, ios-bridgesupport bricks springboard.. which is kinda annoying because you are forced to reflash the phone :) I have been investigating the issue, and I will like to know if there's any way to specify a different path to find those bridgesupport files. Thanks |
I agree. I've had similar issues in the past. The ability to pull bridgesupport files from an external location would be very appreciated. |
I have modified the NodObjC library (lib/import.js) to load the bridgesupport from "/usr/local/System/Library/Frameworks". That worked fine, so i will modify my ios-bridgesupport cydia package to install there. If there's any BS directory in the filesystem, the SpringBoard will crash and you'll get a bricked iDevice. It would be good to have a standard path for this, or handle an environment variable to choose the user-defined path. After this I created an standalone /Applications/NodeJS.app with icon, launcher script and nodejs hello world for iOS. @TooTallNate i dont need to debug anything. by googling a bit I found that the assert in UIApplicationMain means that the referenced class does not exist. So i registered.
The problem is that applicationDidFinishLaunching is never called, so I can't initialize the window and the OS kills the app. I need to define the AppDelegate class in code to match:
How can I do this? i can't find any way to specify that this object will understand the UIApplicatinDelegate protocol.. |
@radare So I think you're simply not registering the proper methods to invoke. It should be To answer your second question, you don't actually have to specify anywhere that the object implements the |
Also: AppDelegate('respondsToSelector','viewDidLoad'); ^ FYI, that line doesn't seem to do anything. |
P.S. when you get something that actually boot up, please show me your code! It would be great to add an iOS app to the I'm gonna close this issue, but open another one about the more flexible BridgeSupport file locations and I'll try to get to that soon. |
Sorry for those misstakes. I tried with: AppDelegate.addMethod('applicationDidFinishLa And the fuction was never called :/ maybe this is not the place to discuss this :) I plan to make cydia package for the module and a sample app too. Thanks! |
@radare No prob! And if you're looking for more support come to the #NodObjC IRC room on the freenode network. P.S. if you're looking for some inspiration, check out the OS X GUI app example: https://github.com/TooTallNate/NodObjC/blob/master/examples/NodeCocoaHelloWorld.app/Contents/MacOS/app.js ^ I assume only minor tweaks would be needed to get an iOS app going... |
I have compiled the nodobjc nodejs module (node-ffi, libxmljs) for iOS, and I'm using it on a jailbreaked iOS 5.0.1. with node from cydia.
The first function to create an iOS app is UIApplicationMain().
This function is described in the BridgeSupport files that can be found here (https://github.com/innoying/iOS-BridgeSupport) (extract the contents of src/ to /).
This is the code i'm trying to run:
This is the output:
Looks like there's a problem trying to unwrap the function arguments. How is ^* (char**) suposed to be used? is this a bug in nodobjc? am i doing something wrong?
The text was updated successfully, but these errors were encountered: