Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct path for #import of iPhone Frameworks (ALAssetsLibrary.h)

This may be the easiest points out there but it is stumping for some reason. I am trying to include the AssetsLibrary Framework and having issues with getting the compiler to see the actual include file for ALAssetsLibrary when using relative paths.

I am currently using:

#import </Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/AssetsLibrary.framework/Headers/ALAssetsLibrary.h>

And this works but is oh so bad in that it calls out the device and specific OS build. I have added the framework and everything links and runs. I just really do not like using the above absolute path and cannot get any relative paths to work. I have tried many combinations of using quotes ("") and braces (<>). Various relative paths to just System, Library, System/Library...

XCode specifics: XCode 3.2.5

Component versions Xcode IDE: 1760.0 Xcode Core: 1763.0 ToolSupport: 1758.0

like image 638
Steven Noyes Avatar asked Dec 31 '10 17:12

Steven Noyes


2 Answers

Found it. Don't know why I did not think of this earlier...

#import <AssetsLibrary/AssetsLibrary.h>

Simple.

like image 153
Steven Noyes Avatar answered Nov 09 '22 10:11

Steven Noyes


In Swift:

Please first of all add the AssetsLibrary framework to your Xcode project: click on the name of your project in the project navigator < Then click on the name of your project under TARGETS < Then click on Build Phases < Then click on Link Binary With Libraries < Then click on the "+ button" and add the AssetsLibrary.framework

Finally add this import below at the top of your swift class:

import AssetsLibrary
like image 4
King-Wizard Avatar answered Nov 09 '22 10:11

King-Wizard