Error phonegap xcode

I have a phonegap project on Android. It looks good, but when I go to the phonegap site, I have some problems with the ios version.

Therefore, I am trying to use xcode using the xcode simulator, but I have the following error:

2013-04-03 21:29:27.261 Assas[2339:c07] Multi-tasking -> Device: YES, App: YES 2013-04-03 21:29:28.455 Assas[2339:c07] [LOG] true 2013-04-03 21:29:28.940 Assas[2339:c07] -[__NSCFArray dataUsingEncoding:allowLossyConversion:]: unrecognized selector sent to instance 0x8939150 2013-04-03 21:29:28.942 Assas[2339:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray dataUsingEncoding:allowLossyConversion:]: unrecognized selector sent to instance 0x8939150' *** First throw call stack: (0x14c012 0x25a2e7e 0x1d74bd 0x13bbbc 0x13b94e 0x163b0 0x16243 0x5bbdb 0x5b32c 0x5aedd 0x5b075 0x5af93 0x25b66b0 0x1125765 0xcff3f 0xcf96f 0xf2734 0xf1f44 0xf1e1b 0x33d37e3 0x33d3668 0x387ffc 0x214c 0x20a5) libc++abi.dylib: terminate called throwing an exception 

I take the contents of my www folder in my Android project, I just change config.xml and jsfile cord

I am using phonegap 2.4.0 for both projects

edit:

error in other sources /main.m

 #import <UIKit/UIKit.h> int main(int argc, char* argv[]) { @autoreleasepool { int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); return retVal; } } 

in line 6

thanks

+4
source share
3 answers

cordova java script is different for Android and ios. Therefore, when you copy your www, make sure you replace android cordova.js with ios cordova.js.

0
source

Your application uses automatic link counting (which is new), and Phonegap does not yet support it. The solution is below:

1. Go to the project build settings and turn off automatic link counting. Build Settings - User Defined-CLANG_ENABLE_OBJC_ARC- change from YES to NO

2. Dangerous / bad, but allow the error: delete @autoreleasepool, the code seems int main(int argc, char* argv[]) { int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); return retVal; } int main(int argc, char* argv[]) { int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); return retVal; }

0
source

For me, I changed the order of the plugin parameters in my plugin javascript file, but I did not reflect these changes in the iOS code. I send a combination of strings, longs and ints in my plugin options:

 // Old javascript cordova.exec(success, fail, "MyPlugin", "PluginMethod", [0, 758493037474, "String"]); // New javascript cordova.exec(success, fail, "MyPlugin", "PluginMethod", ["String", 0, 758493037474]); 

Make sure you also update your code (no duh, right !!!)

 // Old objective C int myid = [command.arguments objectAtIndex:0]; double mydouble = [[command.arguments objectAtIndex:1] doubleValue]; NSString *mystring = [command.arguments objectAtIndex:2]; // New objective C NSString *mystring = [command.arguments objectAtIndex:0]; int myid = [command.arguments objectAtIndex:1]; double mydouble = [[command.arguments objectAtIndex:2] doubleValue]; 
0
source

All Articles