This is the code
Dest.h
#import <UIKit/UIKit.h>
#import <CoreGraphics/CGPDFArray.h>
@class Model;
// snip
@interface Dest : NSObject
{
CGPDFArrayRef destArray;
DestKind kind;
}
+ (id)destWithObject:(CGPDFObjectRef)obj inModel:(Model*)model;
- (id)initWithArray:(CGPDFArrayRef)array;
Dest.m
@implementation Dest
+ (id)destWithObject:(CGPDFObjectRef)obj inModel:(PDFModel*)model
{
CGPDFArrayRef array = NULL;
Dest* dest = nil;
// stuff to create array
if (array)
{
dest = [[[Dest alloc] initWithArray:array] autorelease];
<path>/Dest.m:63: warning: passing argument 1 of 'initWithArray:' from incompatible pointer type
}
return dest;
}
Clearly the compiler thinks that array is incompatible with initWithArray:
declared in Dest.h
. But as far as I can see, the type is exactly right. I even copied the declaration from Dest.h
and pasted it in Dest.m
. initWithArray:
compiles fine. Adding/removing the CGPDFArray.h
header file in Dest.h
doesn't make any difference, the compiler doesn't think it is an int in Dest.h
.