home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / OneObjectDataSource.m < prev    next >
Encoding:
Text File  |  1996-08-23  |  1.1 KB  |  49 lines

  1. /*
  2.         Copyright (c) 1996, NeXT Software, Inc.
  3.         All rights reserved.
  4.  
  5.         You may freely copy, distribute and reuse the code in this example.
  6.         NeXT disclaims any warranty of any kind, expressed or implied,
  7.         as to its fitness for any particular use.
  8. */
  9. #import "OneObjectDataSource.h"
  10.  
  11. @implementation OneObjectDataSource
  12.  
  13. - initWithGlobalID:(EOGlobalID *)gid editingContext:(EOEditingContext *)context;
  14. {
  15.     [super init];
  16.     obj = [[context faultForGlobalID:gid editingContext:context] retain];
  17.     [context retain];
  18.     return self;
  19. }
  20.  
  21. - (void)dealloc
  22. {
  23.     [[obj editingContext] autorelease];
  24.     [obj release];
  25.     [super dealloc];
  26. }
  27.  
  28. - (NSArray *)fetchObjects
  29. {
  30.     return [NSArray arrayWithObject:obj];
  31. }
  32.  
  33. - (EOEditingContext *)editingContext
  34. {
  35.     return [obj editingContext];
  36. }
  37.  
  38. - (EODataSource *)dataSourceQualifiedByKey:(NSString *)key
  39. {
  40.     return [[[EODetailDataSource alloc] initWithMasterDataSource:self detailKey:key] autorelease];
  41. }
  42.  
  43. - (EOClassDescription *)classDescriptionForObjects
  44. {
  45.     return [obj classDescription];
  46. }
  47.  
  48. @end
  49.