• 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: OK to talk about 3.2.2+ and new compiler?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OK to talk about 3.2.2+ and new compiler?


  • Subject: Re: OK to talk about 3.2.2+ and new compiler?
  • From: Paul Summermatter <email@hidden>
  • Date: Mon, 21 Jun 2010 10:02:37 -0400

Lance et al,

	No, I think you've understood and explained it quite well.  I forgot that autorelease returns an untyped object.  I've been in the Java world too long and have forgotten some of these subtleties/annoyances of Objective-C.

	Is there an option that we can enable to force the compiler to emit warnings any time we make assignments to untyped classes?  I really hate the fact that mistakes like these are so simple to make.

Regards,
Paul

On Jun 21, 2010, at 9:55 AM, lbland wrote:

> Paul,
>
> On Jun 21, 2010, at 9:45 AM, Paul Summermatter wrote:
>
>> 	self.myButton.imageView.image = [[[OurCustomViewSubclass alloc] init] autorelease];
>>
>> 	Our current compiler settings do not emit any warnings or failures for this line of code where we are assigning something that should be a UIImage to something that is actually a UIImageView.  Does anyone know of a setting that will force the compiler to do stronger checking here?
>
> ... your description is incomplete (what is OurCustomViewSubclass subclassed from??, probably UIView ?).
>
> Anyways, since autorelease returns type "id", it is an un-typed return and no strong type checking can be performed at compile time.
>
> assigning from "id" is like assigning a pointer from (void *) in C ... it is outside strong typing.
>
> ... but maybe I'm not understanding your issue.
>
> thanks!-
>
> -lance
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >OK to talk about 3.2.2+ and new compiler? (From: Paul Summermatter <email@hidden>)
 >Re: OK to talk about 3.2.2+ and new compiler? (From: Roland King <email@hidden>)
 >Re: OK to talk about 3.2.2+ and new compiler? (From: Paul Summermatter <email@hidden>)

  • Prev by Date: extra boost libraries
  • Next by Date: Continuous integration and testing services
  • Previous by thread: Re: OK to talk about 3.2.2+ and new compiler?
  • Next by thread: Re: OK to talk about 3.2.2+ and new compiler?
  • Index(es):
    • Date
    • Thread