Skip to content
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

Quiet #warnings in XCDYouTubePlayerScript.h #58

Closed
anasb opened this issue Jul 27, 2014 · 4 comments
Closed

Quiet #warnings in XCDYouTubePlayerScript.h #58

anasb opened this issue Jul 27, 2014 · 4 comments
Labels

Comments

@anasb
Copy link

anasb commented Jul 27, 2014

Hi,

It would be nice to quiet down the 2 warnings in XCDYouTubePlayerScript.h:10-14, and perhaps replace them by #pragma mark.

#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0
#warning Rewrite JavaScriptCore code with JSContext + JSValue (available since iOS 7) instead the verbose C API.
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9
#warning Rewrite JavaScriptCore code with JSContext + JSValue (available since OS X 10.9) instead the verbose C API.
#endif

Thank you for this great tool !

@0xced
Copy link
Owner

0xced commented Jul 29, 2014

If I remove the warning, then I will inevitably forget to update the code to the new JavaScriptCore API when dropping support for iOS 5 and 6.

But I have a solution for you anyway. If you are integrating XCDYouTubeKit manually, you should not drag and drop the source code in your own project but use an Xcode workspace and use the XCDYouTubeKit iOS or XCDYouTubeKit OS X target, exactly like the demo project does. Since they have their deployment targets set to iOS 5.0 and OS X 10.7 they won’t produce any warnings.

If you are integrating with CocoaPods, you can add this line in your Podfile and all the warnings will disappear:

inhibit_all_warnings!

@0xced 0xced closed this as completed Jul 29, 2014
@anasb
Copy link
Author

anasb commented Jul 29, 2014

Thank you for your answer.

I actually use :inhibit_warnings => true just for this pod, but I usually don't like to do so. I prefer knowing when it generates warnings to make sure nothing might be unstable. No worries though :) Thanks!

@0xced
Copy link
Owner

0xced commented Jul 29, 2014

Hehe, I’m going to blame CocoaPods on that one. I have specified s.ios.deployment_target = "5.0" in the podspec but the generated Pods-XCDYouTubeKit target of the Pods project has a deployment target equal to what is specified in the Podfile instead of what I specified in the podspec.

I’m going to discuss this issue with the CocoaPods team but in the meantime your solution to use :inhibit_warnings => true just for this pod is a good workaround.

Also, rest assured that I take warnings very seriously, the XCDYouTubeKit project has the -Werror flag which turn warnings into errors so that I can’t even compile the project as soon as a waring appear.

@0xced 0xced added the wontfix label Jul 31, 2014
@0xced 0xced mentioned this issue Aug 1, 2014
@0xced
Copy link
Owner

0xced commented Sep 17, 2015

These warnings are gone as of version 2.3.0. The XCDYouTubePlayerScript class has been rewritten with the JavaScriptCore Objective-C API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants