• 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: NSArray firstObject?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray firstObject?


  • Subject: Re: NSArray firstObject?
  • From: Gordon Apple <email@hidden>
  • Date: Mon, 23 Dec 2013 10:02:47 -0500
  • Thread-topic: NSArray firstObject?

That¹s also a problem with re-declared methods not labeled as IBAction, such
as a few contained in NSTextView. (e.g., superscript, subscript.)

Another point with firstObject.  I assumed this was the same as array[0] or
objectAtIndex:0, but apparently not so.  If I remember correctly, these
result in a range exception if the array is empty.  FirstObject is a better
choice and avoids having to pre-check for count != 0.


On 12/22/13 3:00 PM, "email@hidden"
<email@hidden> wrote:

> So just declare it in a category and leave it out of the implementation? That
> of course gives me a warning that my implementation is incomplete.
> -(id)firstObject;


_______________________________________________

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: NSArray firstObject?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Sandboxing: Can't bookmark enclosing folder of user-selected file
  • Next by Date: Re: PDFView not rendering pages on scroll
  • Previous by thread: Re: NSArray firstObject?
  • Next by thread: Re: NSArray firstObject?
  • Index(es):
    • Date
    • Thread