• 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: Needed : set class for Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Needed : set class for Cocoa


  • Subject: Re: Needed : set class for Cocoa
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 5 Feb 2009 15:59:52 -0800

On Feb 5, 2009, at 15:29, Tommy Nordgren wrote:

Do anyone know of a set container class for Cocoa objects, that use pointer semantics.

Like this:
NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy];


Somesetclass *someSet = [[Somesetclass alloc]init];
[someSet add:s1];
[someSet add: s2];
// After these calls, someSet should contain 2 elements because s1 ! = s2 by pointer semantics

You could try:

	http://developer.apple.com/documentation/Cocoa/Reference/NSHashTable_class/Introduction/Introduction.html

with maybe 'NSPointerFunctionsStrongMemory | NSPointerFunctionsOpaquePersonality' for the options.

Alternatively, you can use NSSet with values "encoded" by [NSValue valueWithPointer: someObject], and "decoded" by [someValueObject pointerValue].



_______________________________________________

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: Needed : set class for Cocoa
      • From: Quincey Morris <email@hidden>
References: 
 >Needed : set class for Cocoa (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Needed : set class for Cocoa
  • Next by Date: Re: Needed : set class for Cocoa
  • Previous by thread: Re: Needed : set class for Cocoa
  • Next by thread: Re: Needed : set class for Cocoa
  • Index(es):
    • Date
    • Thread