Jul 16, 2013

XCode 4.2 and Phonegap / Cordova and CDVInvokedUrlCommand compile error [Solved]

Posted Jul 16, 2013
When you download Cordova / Phonegap and create an iOS project using the create command, the resulting project has many compile errors if you do not use XCode 4.5. It is also written in their documentation and at least XCode 4.5 is needed to run their project.

Those using Snow Leopard OS are stuck with XCode 4.2, so it would be helpful if phonegap / apache cordova runs in XCode 4.2.

The first error you will encounter is Automatic Reference Counting Issue of CDVInvokedUrlCommand for instance message does not declare a method with selector... on line 62 of CDVInvokedUrlCommand.m with the code: [self massageArguments];

Found out that the compatibility issue was just due to declarations, position of methods, and use of new syntax (The "at" syntax of new iOS @{} for NSDictionary). So I just changed the code to be compatible with older version of compiler / SDK and it worked! I was able to compile and run it in my simulator.



I uploaded the working sample project in github: https://github.com/mannyvergel/cordova-ios-xcode-4.2


2 comments: