• 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: NSEnumerator doesn't support NSCopying - why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEnumerator doesn't support NSCopying - why?


  • Subject: Re: NSEnumerator doesn't support NSCopying - why?
  • From: Wade Tregaskis <email@hidden>
  • Date: Mon, 16 Feb 2004 22:30:45 +1100

Anyone know why an NSEnumerator (NSIdEnumerator, in this particular case) can't be copied, and some way to get around this, aside from the obvious i,j loop?

The double while loop construct above makes no sense to me... I guess you cut out the reason behind the double loop. I personally would use a single while loop (avoid scanning NxN[-1?]) and use continue to skip items and if/else logic for selective processing, etc.

There is no way of doing so.

Anyway what are you trying to do?

Compare each possible pairing of items in the list. It's a very simple procedure, albeit an inefficient one (not an issue in this case).

Why can't the inner while loop get its own enumerator by calling objectEnumerator?

Because then I'll end up wasting twice as much time by ending up checking each pair twice, since you need only check the pairs from one end, not both.

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSEnumerator doesn't support NSCopying - why? (From: Wade Tregaskis <email@hidden>)
 >Re: NSEnumerator doesn't support NSCopying - why? (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: How do I soft-wrap text at a specific line length?
  • Next by Date: Re: NSTableView/NSPopUpButtonCell Mysteries
  • Previous by thread: Re: NSEnumerator doesn't support NSCopying - why?
  • Next by thread: Re: NSEnumerator doesn't support NSCopying - why?
  • Index(es):
    • Date
    • Thread