• 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: Copying Notification Dictonaries & sortingUsingSelector problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying Notification Dictonaries & sortingUsingSelector problems


  • Subject: Re: Copying Notification Dictonaries & sortingUsingSelector problems
  • From: Alexander Griekspoor <email@hidden>
  • Date: Mon, 01 Jul 2002 10:30:36 +0200

Finally after six days, the windows IT guys have managed to fix our email
server again. The simply bought a new one...
So at last I can thanks you enormously Andreas!

>One thing you might want to look at is NSDictionary's
>keysSortedByValueUsingSelector: method. This returns an array of the
>keys in the dictionary (your NSCalendarDates) in the order they'd be in
>based on the sort order of the values (your Experiment objects). In
>that case, the message would be sent to your Experiment objects and you
>can do what you like with it.

>- (NSComparisonResult)sortExperiments:(Experiment *)otherExperiment {
> return [[self stopdate] compare:[otherExperiment stopdate]];
>}

(Simple!)

Simple it is and it works beautifully!! And of course I made sure that I
uses Charles advice to prevent memory leakage when replacing the old array
with the newly sorted one ;-)

Alex

*********************************************************
** Alexander Griekspoor **
*********************************************************
The Netherlands Cancer Institute
Department of Tumorbiology (H4)
Plesmanlaan 121, 1066 CX, Amsterdam
Tel: + 31 20 - 512 2023
Fax: + 31 20 - 512 2029
E-mail: email@hidden
Web: http://go.to/neefixlab
*********************************************************
The requirements said: Windows 2000 or better.
So I got a Macintosh.
*********************************************************
_______________________________________________
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.

  • Prev by Date: Re: NSCopyBits and expose events
  • Next by Date: Re: Getting the version of an application.
  • Previous by thread: Re: NSCopyBits and expose events
  • Next by thread: Re: Getting the version of an application.
  • Index(es):
    • Date
    • Thread