• 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: warning: assignment from distinct Objective-C type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: assignment from distinct Objective-C type


  • Subject: Re: warning: assignment from distinct Objective-C type
  • From: Stuart Malin <email@hidden>
  • Date: Tue, 11 Mar 2008 12:49:07 -1000

Thanks everybody who replied.
From the conversation, I now understand why the two line version didn't have the compiler warning while the one line version did: once the +alloc was assigned to an ivar, the compiler then knew which of the multiple -init methods to use. I thought I was adding value with my approach, but I know see the troubles I was causing... Enough said.


On Mar 11, 2008, at 11:58 AM, Mike Abdullah wrote:

Well because you simply cannot do this. Somehow every single class would have to declare their own version of the +alloc method that returns an object of their specific type. Do you really want the hassle of having to do that every single time you create a subclass? This is not something that can be changed in the framework, but would have to be a change to the language/runtime.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >warning: assignment from distinct Objective-C type (From: Stuart Malin <email@hidden>)
 >Re: warning: assignment from distinct Objective-C type (From: Chris Hanson <email@hidden>)
 >Re: warning: assignment from distinct Objective-C type (From: Stuart Malin <email@hidden>)
 >Re: warning: assignment from distinct Objective-C type (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Launch Daemon Best Practices?
  • Next by Date: Re: warning: assignment from distinct Objective-C type
  • Previous by thread: Re: warning: assignment from distinct Objective-C type
  • Next by thread: Re: warning: assignment from distinct Objective-C type
  • Index(es):
    • Date
    • Thread