• 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
NSEnumerator and the missing peek method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSEnumerator and the missing peek method


  • Subject: NSEnumerator and the missing peek method
  • From: Jan Vereecken <email@hidden>
  • Date: Thu, 29 Sep 2005 22:53:50 +0200

Hello,

I'm currently busy with a project where I regularly make use of a NSEnumerator object to iterate over a set of objects. The "problem" I'm experiencing is that there is no method to peek at the next object (for example [enumerator hasNext]). I circumvent the need to peek via the enumerator with counting the objects of the enumerator ([[enumerator allObjects] count]) and check when the last element is reached (and do something).

The questions :
- Why didn't the AppKit developers include this (the hasNext method) in the first place?
- How do other developers conquer this problem?


With kind regards,
Jan Vereecken
_______________________________________________
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


  • Follow-Ups:
    • Re: NSEnumerator and the missing peek method
      • From: j o a r <email@hidden>
    • Re: NSEnumerator and the missing peek method
      • From: "John C. Randolph" <email@hidden>
    • Re: NSEnumerator and the missing peek method
      • From: Nick Zitzmann <email@hidden>
    • Re: NSEnumerator and the missing peek method
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: Re: Assistance with authentication
  • Next by Date: Re: String->HTML
  • Previous by thread: RE: Obtaining information about the System's current cursor
  • Next by thread: Re: NSEnumerator and the missing peek method
  • Index(es):
    • Date
    • Thread