I know this is a very simple question but I have been struggling with it for a while. I have read a few threads but still can seem to find the answer.
I am trying t
First, please do not add the DDMathParser code to your project via a subfolder copy. Doing so will make it a pain to easily grab any future updates to the code and in general is not a very good approach to including external code in your projects.
Instead, you should add the git repo as a submodule of your project (you are using git, right?) and import the relevant files to your project. Here's a step-by-step solution:
git submodule add https://github.com/davedelong/DDMathParser.git External/DDMathParser
. This will create a new subdirectory named External to your project root directory and inside External the DDMathParser project will be copied.<Your Root Project Dir>/External/DDMathParser/DDMathParser
directory. Be sure to check the "add to targets" checkbox and not to check the "copy items" checkbox.#import "DDMathParser.h"
to your viewcontroller.DDMathParser should now work as you expect. If the author comes out with an update to the code you can just issue the following command from terminal to pull the latest updates from github: git submodule update
.
Note: I created a new project from scratch, followed these steps and included your NSLog()
example to ensure that there aren't any issues.
I followed these steps too, until I could make it work. The suggested method has some flaws.
As the guy before me had it --- You only bring in the SOURCES of DDMathParser, and compile them as part of your target. This binds you to use the same build-settings, SDK version and deployment system-version as the author of DDMathParser. Examples:
I don't know what happens if I push my parent repo to the server, and another friend pulls it. Will he receive the DDMathParser repo automatically? How? He must have access to it! The scheme does not seem complete to me.
I will suggest to aid the author in packaging his DDMathParser as a framework, and then you will be able to import the PROJECT FILE of DDMAthParser into your project --- not the sources, and simply link against the product of DDMathParser project (a private framework). Seems much nicer. the framework can be compiled using the author's settings, and we just receive the nicely-packaged binary.