开发者

How do I add ApplicationServices so I can #import <ImageIO/ImageIO.h>?

开发者 https://www.devze.com 2023-01-13 07:44 出处:网络
Apple\'s Image I/O programming guide says: Image I/O resides in the Application Services framework in Mac OS X, and in

Apple's Image I/O programming guide says:

Image I/O resides in the Application Services framework in Mac OS X, and in the Image I/O framework in iOS. After adding the framework to your application, import the开发者_如何学C header file by including this statement:

#import <ImageIO/ImageIO.h>

I must be "adding the framework" wrong because when I add the #import line to my code and compile I get an error "ImageIO/ImageIO.h: No such file or directory". Can someone tell me what I'm doing wrong?

I did the following in Xcode to get the error.

  1. New Project (OS X Cocoa Application)
  2. In the "Groups & Files" tree select MyProjectName/Frameworks/Other Frameworks...
  3. Right click and select Add > Existing Frameworks
  4. Under "Mac OSX 10.6 SDK" in the dialog that appears, choose "ApplicationServices.framework"
  5. In MyProjectName.m (or any other file) add #import <ImageIO/ImageIO.h>

I'm using Xcode 3.2.3 on OS X 10.6.4 and have 10.6 SDK (10M2262).

I've also tried adding the framework using Project > Add to Project.. and choosing the framework from the SDK and from /System/Library/Frameworks and get the error in all cases.


You've added the framework correctly. What's causing your problem is that you shouldn't import ImageIO's header specifically; you should import the ApplicationServices header.

You may want to file a bug against the documentation.


I had a similiar experience, as I am still on XCode 3.2, in addition to what is said above, I had to use the Foundation tool template when creating a new project, so I suspect everything would have been good if I had added the Foundation framework to the make file.

But when stuff like this happens, then I drop into XCode, and tries to solve it from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消