How to avoid "Unknown identifier" when building?


I used iPhoneUtils class methods in my script for iOS platform game and tried to switch platform to Mac and build it. But I can't build with error: "Unknown identifier: 'iPhoneUtils'.".

How can I avoid this error without commenting this line out because maybe I will forget to remove the comment line back in iOS platform?

Thank you.

You can use platform dependent directives to wrap code that should only be executed/compiled on a particular platform:

In your case, wrap all code that is strictly for the iPhone in:

[your code here]