/Tools/nib2cib/NSObjectController.j

http://github.com/cacaodev/cappuccino · Unknown · 67 lines · 53 code · 14 blank · 0 comment · 0 complexity · dd4c264c84ab2bb8f132e796f13de916 MD5 · raw file

  1. /*
  2. * NSObjectController.j
  3. * nib2cib
  4. *
  5. * Created by Ross Boucher.
  6. * Copyright 2010, 280 North, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. @import <AppKit/CPObjectController.j>
  23. @global CP_NSMapClassName
  24. @implementation CPObjectController (NSCoding)
  25. - (id)NS_initWithCoder:(CPCoder)aCoder
  26. {
  27. self = [super init];
  28. if (self)
  29. {
  30. _declaredKeys = [aCoder decodeObjectForKey:@"NSDeclaredKeys"];
  31. var className = [aCoder decodeObjectForKey:@"NSObjectClassName"];
  32. if (className)
  33. _objectClassName = CP_NSMapClassName(className);
  34. else
  35. _objectClass = [CPMutableDictionary class];
  36. _isEditable = [aCoder decodeBoolForKey:@"NSEditable"];
  37. _automaticallyPreparesContent = [aCoder decodeBoolForKey:@"NSAutomaticallyPreparesContent"];
  38. }
  39. return self;
  40. }
  41. @end
  42. @implementation NSObjectController : CPObjectController
  43. {
  44. }
  45. - (id)initWithCoder:(CPCoder)aCoder
  46. {
  47. return [self NS_initWithCoder:aCoder];
  48. }
  49. - (Class)classForKeyedArchiver
  50. {
  51. return [CPObjectController class];
  52. }
  53. @end