vstirbu / InstagramPlugin

Instagram plugin for PhoneGap/Cordova
MIT License
120 stars 78 forks source link

No know class method for selector error #56

Closed okonon closed 8 years ago

okonon commented 8 years ago

i am running cordova-ios 4.0.1 and when this plugin is added it throws following error:

platforms/ios/Frockhub/Plugins/cordova-instagram-plugin/CDVInstagramPlugin/CDVInstagramPlugin.m:63:36: error: no known class method for selector 'dataFromBase64String:'
        NSData *imageObj = [NSData dataFromBase64String:objectAtIndex0];
                                   ^~~~~~~~~~~~~~~~~~~~
1 error generated.

here is my info:

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.2.4
Ionic CLI Version: 2.0.0-beta.12
Ionic App Lib Version: 2.0.0-beta.6
ios-deploy version: 1.8.4 
ios-sim version: 4.1.1 
OS: Mac OS X El Capitan
Node Version: v4.2.3
Xcode version: Xcode 7.2 Build version 7C68 
vstirbu commented 8 years ago

When using the plugin in an ionic/angular application you have to use the corresponding ng-cordova plugin. Check #55 to see if you are in the same situation. If not, could you share the code where you use the plugin.

okonon commented 8 years ago

@vstirbu Thanks a lot for prompt reply! this error is happening when i run cordova run ios --device so this prevents me form compiling the app, therefore it should not matter how i use the code because i can't compile the app. If i downgrade cordova-ios to 3.9.x you plugin compiles fine and my code is working. this issue is related to some of the cordova-ios changes and requires all plugins to address it. I think they added support to all of their core plugins already. I have another plugin from different project that is throwing a different error because of these changes: https://github.com/Telerik-Verified-Plugins/Keychain/issues/2

Does it make more sense? I wish i had more experience to look into it myself...

funkjedi commented 8 years ago

Just posted a pull request with a fix that worked for me. Apparently dataFromBase64String was deprecated in 3.8.0 and removed in 4.x.x.

okonon commented 8 years ago

@funkjedi NICE!!!!!!!