While developing iOS project, might be you get chance to face the Lexical or Preprocessor Issue. As a iOS developer i too face such issue. We have often think then how to solve this issue? For new developer or those who were not aware how to solve this issue, for them today i am explaining how to fix this.
This kind of issue generally arise due to framework or 3rd party library is not imported properly. For that ensure the framework and all it's headers are imported into your project properly. When you shift your code from one pc to another, then also get this kind of issue for some libraries. The reason for that is due to project "Search Paths" in settings are mismatch. To resolve this remove old instance of the path from "Search Paths" option from Build Settings.
Project > Select Project Target > Build Settings > Search Paths (see below image for reference)
When you move your code from one pc to another, and your manual added library path is of your pc is not match in another pc, so try to remove library from reference and again add it manually. To avoid this issue prefer to use "cocoapods" library management tool. For new or those who were not aware with the cocoa pods refer this tutorial. CocoaPods is the best way to manage library dependencies in iOS and OS X projects. On above tutorial i explain how to mange and install cocoapods on mac.
Give your comment if require my help to fix this kind of error for ios coding, Happy coding.
This comment has been removed by a blog administrator.
ReplyDeleteThanks helped allot
ReplyDeleteWelcome. Happy to help you.
DeleteI have created new project and include UISearchDisplayDelegate which is deprecated in ios 8, So trying to put checking of ios version as bellow:
ReplyDelete#if !IOS_NEWER_OR_EQUAL_TO_8
UISearchDisplayDelegate
#endif
and getting the lexical or preprocessor issue
Thanks from the Philippines!
ReplyDeleteRaymond
Welcome. Happy to help you.
DeleteI have the issue for facebooksdk/facebooksdk.h
ReplyDeleteI have done all the possible steps of adding, cleaning, etc. But the error continues. It says lexical/preproccessor error; facebooksdk/facebooksdk.h file not found within appdelegate.h
Are you using latest Facebook SDK?
Delete'MobileVLCKit/MobileVLCKit.h' file not found
ReplyDeleteTry to follow wiki from MobileVLC Kit. Reference: https://cocoapods.org/pods/MobileVLCKit
Delete