• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mysterious warning (initialization from distinct Objective-C type)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious warning (initialization from distinct Objective-C type)


  • Subject: Re: Mysterious warning (initialization from distinct Objective-C type)
  • From: Mason Mark <email@hidden>
  • Date: Fri, 23 Sep 2005 12:02:43 +0900

You're right; I re-checked and I was actually wrong about the return type The -mainView method indeed was written to return NSView * and not id.

So, in both cases the warnings were legitimate and the error was mine; my apologies to GCC. ;-)

Cheers,
--
Mason Mark
Five Speed Software, Inc.

On Sep 22, 2005, at 1:30 PM, Chris Hanson wrote:

On Sep 20, 2005, at 10:35 PM, Mason Mark wrote:


I am chiming in here to keep Dan's thread alive, since there seems to be no answer yet, and add a couple of data points.

FSColoredView *v = [self mainView]; // returns an id: -(id) mainView;

The line of code above generates the warning. I am not building a universal binary.

I started getting this warning after upgrading to GCC 4.0.1.


Is the declaration of the FSColoredView class actually in scope at this point? (E.g. have you #included FSColoredView.h, which includes the primary @interface declaration for FSColoredView?) Or do you just have a forward declaration of the class?


Alternately, is the signature of -mainView that the compiler knows about at that point in your file really -(id)mainView? Or is it - (SomeKindOfView *)mainView?

  -- Chris



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Mysterious warning: (From: Dan Wood <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Mason Mark <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Chris Hanson <email@hidden>)

  • Prev by Date: NSTextField delegate how to?
  • Next by Date: Timer firing not by set interval
  • Previous by thread: Re: Mysterious warning (initialization from distinct Objective-C type)
  • Next by thread: output from a mouse event
  • Index(es):
    • Date
    • Thread