3

Everything else in XCode4 works correctly, except the ImageKit classes.

Following Apple's tutorials, all classes and protocols starting "IKImage" are "not found" - it will compile against some of them (e.g. IKImageBrowserView), but others it won't even compile - e.g. the protocol IKImageBrowserItem.

It will NOT auto-complete any of them - even the ones that compile.

It seems something is broken - but I don't know what, and I have no idea how to fix it. To summarize:

  1. I'm building against OS X 10.6 - according to Apple's docs, 10.5 includes these files
  2. I've added Quartz framework
  3. I've added Quartzcore framework
  4. I'm importing: #import <Quartz/Quartz.h>

I've checked the actual framework files from Apple, and the Quartz/ImageKit is clearly missing the headers that Apple's docs say should be present :(.

NB: nothing else is missing or broken in my Xcode4 install - I develop OS X 32 and 64 bit apps, and iPhone and iPad apps all fine.

Anything else I should be doing?

Adam
  • 32,900
  • 16
  • 126
  • 153
  • check `System/Library/Frameworks` folder could u see `Quartz.framework` and `QuartzCore.framework` , oh sry i see now you've already added – Synxmax Nov 22 '11 at 08:27

2 Answers2

1

You doesn't have to link IKImageBrowserItem delegate with your own class.

@interface MyOwnClass : NSObject/*<NSImageBrowserKit>*/ 

It's not possible, because the header ImageKit.h is not public.

However, when you add the Quartz framework, IKImageBrowserItem's protocol is already linked to NSObject class, then to your own class.

Apple has made IKImageBrowserItem's protocol like this (in ImageKit/IKImageBrowserView.m file):

@interface NSObject (IKImageBrowserItem)

Indeed this protocol is an extension of NSObject class.

You simply have to implements selectors of IKImageBrowserItem's protocol directly in your own class implementation.

@implementation MyOwnClass

- (NSString *)  imageUID
{
    /*your implementation*/
}

- (NSString *)imageRepresentationType
{
    /*your implementation*/
}

@end

etc ....

Autocompletion will work !

csblo
  • 1,571
  • 13
  • 20
  • Ah, so it's the Apple docs that were wrong - IKImageBrowserItem isn't a protocol at all, it's a class-extension? – Adam Mar 21 '14 at 09:24
  • Indeed... From what I see, it looks more like a single interface with abstract selectors. Tell me if i'm wrong. – csblo Mar 24 '14 at 08:21
  • My Mac license has lapsed (Apple certs broke permanently, couldn't rebuild any apps, I pulled them from app store, waiting for Apple to fix), so I can't check -- but it sounds believable. OS X still has a lot of crummy old API's with weaker design than the modern iOS versions. – Adam Mar 24 '14 at 17:06
0

Does this help

Well, after looking at my #import statements, I realized that the problem was a strange import loop, where I should have used @class. Thanks for pointing me in the right direction!

It's funny how problems seem so much simpler here.

Maybe then the answer, i'm afraid, would be a more specific forum for this type of question in orer to find people that would have sufficient knowledge to answer the question

Paul C
  • 4,687
  • 5
  • 39
  • 55
  • I don't believe that's related. The example you cite is where someone wrote their own protocol. In my case, I'm trying to access Apple's own API, and the header files are being ignored. – Adam Nov 15 '11 at 21:04