Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1070655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:35:53+00:00 2026-05-16T20:35:53+00:00

This is the code Dest.h #import <UIKit/UIKit.h> #import <CoreGraphics/CGPDFArray.h> @class Model; // snip @interface

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:35:53+00:00Added an answer on May 16, 2026 at 8:35 pm

    I have a feeling you’re leaving out another warning that’s relevant — “warning: multiple methods named ‘initWithArray:’ found”. If I’m right, this is what you’re running into:

    1. There are two method signatures that go with that selector. NSArray’s takes an NSArray* and yours takes a CGPDFArrayRef.

    2. alloc returns id. This means that the compiler has no idea what class it returns (yes, the compiler is that thick).

    3. You then send initWithArray: to this mystery object. The compiler says, “Gosh, I don’t know what kind of object this is, so I can’t decide which method signature is correct. I’ll spin around really fast and whichever one I’m facing is the one I’ll pick.” It chooses NSArray’s signature. Then it looks at the argument and says, “Hey, that’s not an NSArray! Error!”

    The quick-and-easy solution is to change it to [[(Dest*)[Dest alloc] initWithArray:array] autorelease]. The better solution is to choose a distinct selector for your method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SimpleTest Object: my .h (header) code: #import <Foundation/Foundation.h> @interface SimpleTest : NSObject @property (strong,
This code comes from: http://code.activestate.com/recipes/577090-file-encryption-using-stream-cipher/ import sys import random if len(sys.argv) != 4: print
This code produces a different output in Python 2 and Python 3 . class
I have this code: DManag::~DManag() { printf(in dest\n); if(mainConn.IsOpen()) { printf(about to close\n); mainConn.Close();
Hello could someone help me udnerstand how this code works ? go(Start,Dest,Route):- go0(Start,Dest,[],R), rev(R,Route).
Hello could someone help me udnerstand how this code works ? go(Start,Dest,Route):- go0(Start,Dest,[],R), rev(R,Route).
when i want download jpeg in python with this code: def download(url, dest): s
I have a problem with this snippet of code: import optparse parser = optparse.OptionParser(version=__version__,
This code below allows me to find the word error in all my files
This code is the core of a much larger script that works great in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.