• 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: Fwd: anyObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: anyObject


  • Subject: Re: Fwd: anyObject
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 31 Jan 2002 17:41:27 +0100

Robert,

>>>>>> Robert Goldsmith (RG) wrote at Thu, 31 Jan 2002 16:30:21 +0000:
RG> I am trying to use the NSSet method anyObject which, according to the
RG> docs, returns a random object selected from the set or, if the set is
RG> empty, nil.
...
RG> (which shows the values have been stored ok) followed by 100 selections
RG> of the the NSNumber object that holds the value 0.
RG>
RG> Any suggestions?

Sure, to consider what the method is used for!

The "randomness" means there is no way to tel before which object will be
returned, *NOT* that it would or should be a different one each time.

Actually, the reason of the method is to give a _REPRESENTANT_ of the set.
It is selected always by the same algorithm, and thus unless set contents
changes, the representant will always be the same.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc


  • Follow-Ups:
    • Re: anyObject
      • From: Robert Goldsmith <email@hidden>
References: 
 >Fwd: anyObject (From: Robert Goldsmith <email@hidden>)

  • Prev by Date: Re: PB bug or feature??
  • Next by Date: Re: PB bug or feature??
  • Previous by thread: Fwd: anyObject
  • Next by thread: Re: anyObject
  • Index(es):
    • Date
    • Thread