Import another project/framework (ADAL) into your project

ref – http://www.insert.io/frameworkios8xcode6/

Let’s say we want to get a project called ADAL from the git repository and then add it to our project as an external framework for us to use.

First, let’s get the project:

git submodule add https://github.com/AzureAD/azure-activedirectory-library-for-objc adal
cd adal
git checkout tags/2.1.0

Optionally, later don’t forget to add this framework to your git, and push it.

cd ..
git add adal
git commit -m “Use ADAL git submodule at 2.1.0”
git push

Locate the ADAL project folder

the adal folder will be downloaded into your root git directory. (the one with the .git hidden folder)
You will see the ADAL project. Inside, you’ll see several folders. Locate the main ADAL folder with the source files by looking for a .xcodeproj file, along with src folder and its header/implementation files.

source_files

Drag the project over

Make sure you drag the .xcodeproj file over to your project space. Open it and you’ll see the src folders and what not. Look in the Products folder. You will see the ADAL.framework. That is what we’ll be importing into our project.

drag_project_over

Select your Target, then Build Phases, then click on Link Binary With Libraries

Also, in Target, then Build Phases, then Target Dependencies, make sure you add the ADAL framework as well

target_link_library

Click on the ADAL framework and import it.

select_it

Make sure you’ve imported the framework. The run the project.

framework_should_appear

Inserting some code

Finally, in your ViewControllelr.m, import the header file and you should get no errors.

add some define strings for the table names in our azure cloud

Let’s create a service so the view controller can communicate with the cloud tables

Set up the service with the table name and query

dyld: Library not loaded

http://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found

After you’d made sure there are no errors, if you run into an image not found error, it just means that in your Target, General, Embedded Binaries, click the ‘+’ button and add the ADAL ios framework from its original directory. (NOT the one you dragged into your project)

add_embedded_binaries