• 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: confused about floats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: confused about floats


  • Subject: Re: confused about floats
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 9 Oct 2010 11:33:04 -0700

On Sat, Oct 9, 2010 at 10:38 AM, Ariel Feinerman <email@hidden> wrote:
>       NSObject *kit;
>>        kit = [[kits selectedObjects] objectAtIndex:0];
>>
>
> // it is more convenience
> id <NSObject> kit;

Why would you do this? It is not more convenient. It is actually a
hell of a lot less convenient, because now the compiler will warn you
about every non-NSObject method you send to kit, even though you might
know that kit responds to it. This includes all system-defined methods
on NSObject-the-class that aren't part of NSObject-the-protocol, like
-valueForKey:.

In fact, I can't think of a situation when it *ever* makes sense to
type something as id <NSObject> rather than NSObject.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: confused about floats
      • From: Ariel Feinerman <email@hidden>
References: 
 >confused about floats (From: Amy Heavey <email@hidden>)
 >Re: confused about floats (From: Ariel Feinerman <email@hidden>)

  • Prev by Date: Re: UITableViewCell Display Issue
  • Next by Date: dictionaryWithObjectsAndKeys
  • Previous by thread: Re: confused about floats
  • Next by thread: Re: confused about floats
  • Index(es):
    • Date
    • Thread