This is RZSortedList.m in view mode; [Download] [Up]
/* * RZSortedList - support object for the RZBrowserCell, a List that * can sort itself in a generic way (it depends on its constituent * objects to conform to the RZSortableObjects protocol) * * You may freely copy, distribute and reuse the code in this example. * This code is provided AS IS without warranty of any kind, expressed * or implied, as to its fitness for any particular use. * * Copyright 1995 Ralph Zazula (rzazula@next.com). All Rights Reserved. * */ #import "RZSortedList.h" @implementation RZSortedList - insertObject:anObject at:(unsigned)index { return [self notImplemented:_cmd]; } - replaceObjectAt:(unsigned)index with:newObject { return [self notImplemented:_cmd]; } - addObject:(id <RZSortableObjects>)anObject { int i = 0; while(i < numElements && ([anObject sortIndex] >= [[self objectAt:i] sortIndex])) { i++; } return [super insertObject:anObject at:i]; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.