can't import AssetsLibrary.h - objective-c

I want to use AssetsLibrary framework to use picture from users photo library. But i have a very strange issue. I see that everybody is importing this framework like this
#import <AssetsLibrary/AssetsLibrary.h>
But i can't and the compiler is showing errors. I even can't find it when adding frameworks in "Link Binaries With Libraries". As if this framework doesn't exist.
Maybe anybody has some similar issues and knows the solution?

Apparently the framework is missing, I've looked for it in the framework dir and it wasn't there, so i chose to redownload new xcode. If anybody has some similar problems I recommend to first look if the framework is not missing in /System/Library/Frameworks/.

Related

(ObjC) Unable to add libraries-Help please

I'm following an objC book and I need to use readline() to obtain a string.
However, before I can even get to that, I need to add the library that contains it. Therefore, I go into Build Phases -> Link Binary With Libraries -> Press the + ->Search and Add addlibreadline.dylib
After I do this, I have an icon under my top-level item that has the name of this library. BUT when I go into my code in main.m, NOTHING is imported. There is no #import
WHY? I have tried different things for hours and am frustrated!
Am I not understanding something about importing and libraries?
Btw: I am using Version 6.1.1 (6A2008a) and Yosemite 10.10.1 (14B25)
Thank you,
Since you've got the libraries linked, try adding this:
#import <readline/readline.h>
Then you should be able to use readline().
http://forums.bignerdranch.com/viewtopic.php?f=148&t=7617

Xcode 4 'QuartzCore/CIColor.h' file not found

I'm running Xcode 4 and trying to follow the steps in Apple's Image Kit Programming Guide (which is written for Xcode 3) on how to work with an Image View and the IKImageView class. I just imported the Quartz and Quartz Core frameworks (from /System/Frameworks directory) to my blank Cocoa Application project using File > Add Files to... menu, but when I try to Run my application I get this error:
Lexical or Preprocessor Issue 'QuartzCore/CIColor.h' file not found
Does anyone know what could be a reason?
Peter Hosey replied:
You're not supposed to import specific headers directly, and especially not from sub-frameworks (such as Core Image, sub-framework of QuartzCore). Only import a framework's overall header, which usually has the same name as the framework.
I didn't import any specific headers directly, I just choose File>Add Files to... then choose /system/Frameworks and choose two folders which contain those frameworks, after that they appeared in my project navigator view as they should, but the code wouldn't compile any more. It shows me NSColor.h file which is found in the AppKit framework, points at this line: #import and says Lexical or Preprocessor Issue 'QuartzCore/CIColor.h' file not found. I have no clue why it wouldn't compile. CI stands for Core Image. I'm now reading a guide on Core Image, maybe this will help. I'd like to post a screenshot but I can't (not enough rights yet).
I just imported the Quartz and Quartz Core frameworks (from /System/Frameworks directory) to my blank Cocoa Application project using File > Add Files to... menu, …
That's not importing; that's just adding it to the project (and hopefully the target). Importing is what you do with the #import directive.
… but when I try to Run my application I get this error: Lexical or Preprocessor Issue 'QuartzCore/CIColor.h' file not found
You're not supposed to import specific headers directly, and especially not from sub-frameworks (such as Core Image, sub-framework of QuartzCore). Only import a framework's overall header, which usually has the same name as the framework.
The problem was that the Guide I used was written for Xcode 3 so when I tried to import/add some frameworks to my project using "File>Add files" menu as described, it did add those frameworks and I could see them in the project navigator, but something went wrong. In Xcode 4 you should use a different way to add/import Frameworks by using the Project Editor> Summary tab> Linked Frameworks and Libraries> Click "+" and then choose the Frameworks you need. That fixed the issue.

xCode 4 import Framework doesn't work

I have added the objection Framework to my project via linked binaries.
Now I am trying to import a file form this framework
#import <Objection/Objection.h>
But the compiler says: Objection/Objection.h not found!
I tried everything,
other linker flags are set to -ObjC and -all_load
Framework search Paths are set to the correct directory
The Library is linked within the project
So what else could be the problem?
Thanks for your help in advance!
When the Objection framework is built for iOS the framework is called 'Objection-iOS.framework'. Ergo the import would look something like this:
#import <Objection-iOS/Objection.h>
Did you add your framework like so ?
In the project navigator, select
your project
Select your target
Select the 'Build Phases' tab
Open 'Link Binaries With Libraries'
expander
Click the '+' button
Select your framework
(optional) Drag and drop the added
framework to the 'Frameworks' group
See Apple's documentation on this
If you have done exactly what I said above then I'm not sure if this is going to work, but I use another method to add frameworks, which is go to your project (The one with the xcodeproj icon), then click on your target. There, you can add the frameworks you want.
If that doesn't work, then try go to /Library/Frameworks to see if your framework you want is still there. If it's there and it's still getting that error, try manually adding the framework which is the add other button when you add a framework.

Box2D compile errors

I've added Box2D to a Cocos2D project I'm working on.
I've followed several guides as to how to do this (all of which seem to differ!).
However, none seem to work.
I'm getting these types of errors:
error: Box2D/Collision/b2BroadPhase.h: No such file or directory
I assumed I'd got the Header Search Paths wrong but have tried all sorts of variants with no luck.
Any suggestions?
The easiest way to use Box2d with your project is to follow these lines:
Copy the Box2d files into a subfolder of your project.
Import these files into your project via Xcode.
After in the "Project navigator", select your target and open the “Build Settings” tab.
Set the "Always Search User Paths" to YES.
Then search for the "User Header Search Path" and add this "${PROJECT_DIR}" (think to check the “recursive path“).
That's all!
You just have to be careful when you want to use Box2d. Think to change the extension of your files from .m to .mm to warn the compiler that the class must be compile as Objective-C++ instead of Objective-C.
I have found a good tutorial here (with Xcode 3.2, but the idea is here). I hope it'll help you.
Alternatively ... After a lot of trouble trying to include box2d in my project, I instead used box2d as a static library - takes a minute to setup, but it's much easier to maintain / add to multiple projects. Step by step guide here:
http://red-glasses.com/index.php/tutorials/box2d-for-ios-made-easy-make-it-a-static-library/

How do I add the library to link the OpenGL framework in iPhone SDK?

I am trying to study OpenGL and I have the framework added, but I am getting linker errors. I believe the issue is adding the library to the project for linking and EVERY time I try to add a library, I hunt around for the configuration setting forever. Someone, please give me the simple click-n-go answer!
The linker cannot find the CAEAGLLayer framework to link against.
Add the QuartzCore.framework and the linker will be able to find the missing framework.
To do this right-click on the Frameworks the choose:
Add > Existing Frameworks > QuartzCore.framework.
alt text http://img19.imageshack.us/img19/223/screenshot20091206at544.png