开发者

IKImageBrowserItem imageRepresentationType error

开发者 https://www.devze.com 2023-02-06 06:25 出处:网络
Just started leaning Cocoa and its dev env, libs, etc. The error I\'m getting: \"_IKImageBrowserNSImageRepresentationType\", referenced from:

Just started leaning Cocoa and its dev env, libs, etc.

The error I'm getting:

"_IKImageBrowserNSImageRepresentationType", referenced from: 
-[ImageBrowserItem imageRepresentationType] in ImageBrowserItem.o
ld: symbol(s) not found

Any ideas on how to fix this error? This method (imageRepresentationType) is required per the IKImageBrowserItem protocol.

The files (.h and .m) that use it are defined thusly:

ImageBrowserItem.h:

#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>

@interface ImageBrowserItem : NSObject 
{
    NSImage *_image;
    NSString *_imageID;
}

@property (readwrite, copy) NSImage *_image;
@property (readwrite, copy) NSString *_imageID;

- (id) imageRepresentation; 
- (NSString *) imageUID;
- (NSString *) imageRepresentationType;

@end

ImageBrowserItem.m:

#import "ImageBrowserItem.h"

@imple开发者_开发百科mentation ImageBrowserItem

@synthesize _image;
@synthesize _imageID;

- (id)  imageRepresentation
{
    return _image;
}

- (NSString *) imageUID
{
    return _imageID;
}

// This method is causing the error. 
/*
  IKImageBrowserNSImageRepresentationType is a constant 
  defined in Apple's IKImageBrowserView.h.
*/
- (NSString *) imageRepresentationType
{
    return IKImageBrowserNSImageRepresentationType;
}

- (void) dealloc
{
    [_image release];
    [_imageID release];
    [super dealloc];
}
@end


Solved: To fix this, if you have this problem, add the Quartz framework as described here: http://developer.apple.com/library/mac/#DOCUMENTATION/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageKitComponents/ImageKitComponents.html#//apple_ref/doc/uid/TP40004907-CH3-SW4

0

精彩评论

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