Friday, January 17, 2014

How to solve Lexical or Preprocessor Issue

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.