• 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: Objective-C and it's future
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and it's future


  • Subject: Re: Objective-C and it's future
  • From: Kenny Leung <email@hidden>
  • Date: Fri, 7 Jul 2006 18:56:45 -0700


On Jul 7, 2006, at 6:40 PM, Thomas Davie wrote:


Very often. 90% of the time I remove something from a container class I get the compiler warning me that it might not respond to the method I'm asking it to respond to, and have to make a cast, that I know is type safe, but the compiler does not. I would much rather have the compiler do this inference for me, because firstly, it stops me from making mistakes, and secondly it saves me a lot of code making casts that do nothing.

You get these warnings 90% of the time when writing Objective-C? You should get no warnings when you have code like the following, provided you have included SuctionBall.h.


- (void)loopOverBalls:(NSArray *)balls
{
int i;
SuctionBall *suctionBall;

for ( i = [balls count] ; i >= 0  ; i-- ) {
    suctionBall = [balls objectAtIndex:i];
    [suctionBall bounce];
    [suctionBall stick];
}
}

-Kenny


_______________________________________________ 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: 
 >Re: Objective-C and it's future (From: Gregory Weston <email@hidden>)
 >Re: Objective-C and it's future (From: Thomas Davie <email@hidden>)
 >Re: Objective-C and it's future (From: Thomas Davie <email@hidden>)

  • Prev by Date: Re: Core Data: Single entity in NSDocument?
  • Next by Date: Re: DVDPlayback
  • Previous by thread: Re: Objective-C and it's future
  • Next by thread: Re: Objective-C and it's future
  • Index(es):
    • Date
    • Thread