From 00d73826fd647817738eb6fa02a48ef7bad1e046 Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 22 Nov 2008 04:07:50 +0000 Subject: [PATCH] * Source/GSNibCompatibility.m: Remove calls to designated initializers for nib files. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27114 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++- Source/GSNibCompatibility.m | 64 +++++++++++++------------------------ 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43dcbe85c..8122d1cb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +2008-11-21 23:12-EST Gregory John Casamento + + * Source/GSNibCompatibility.m: Remove calls to designated initializers + for nib files. + 2008-11-21 01:12-EST Gregory John Casamento * Source/GSNibTemplates.m: Remove calls to designated initializers - as per documentation. + for gorm files as per documentation. 2008-11-20 Wolfgang Lux diff --git a/Source/GSNibCompatibility.m b/Source/GSNibCompatibility.m index c6ffffe63..bcfe8b0d5 100644 --- a/Source/GSNibCompatibility.m +++ b/Source/GSNibCompatibility.m @@ -455,6 +455,23 @@ static BOOL _isInInterfaceBuilder = NO; { _className = [coder decodeObjectForKey: @"NSClassName"]; } + + if (_realObject == nil) + { + Class aClass = NSClassFromString(_className); + if (aClass == nil) + { + [NSException raise: NSInternalInconsistencyException + format: @"Unable to find class '%@'", _className]; + } + else + { + _realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithCoder: coder]; + [[self superview] replaceSubview: self with: _realObject]; // replace the old view... + } + } + + return _realObject; } else { @@ -462,7 +479,7 @@ static BOOL _isInInterfaceBuilder = NO; format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } - return self; + return nil; } - (void) encodeWithCoder: (NSCoder *)coder @@ -473,26 +490,6 @@ static BOOL _isInInterfaceBuilder = NO; } } -- (id) nibInstantiate -{ - if (_realObject == nil) - { - Class aClass = NSClassFromString(_className); - if (aClass == nil) - { - [NSException raise: NSInternalInconsistencyException - format: @"Unable to find class '%@'", _className]; - } - else - { - _realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]]; - [[self superview] replaceSubview: self with: _realObject]; // replace the old view... - } - } - - return _realObject; -} - // setters and getters - (void) setClassName: (NSString *)name { @@ -508,6 +505,11 @@ static BOOL _isInInterfaceBuilder = NO; { return _realObject; } + +- (id) nibInstantiate +{ + return [self realObject]; +} @end // Template for any classes which derive from NSText @@ -530,26 +532,6 @@ static BOOL _isInInterfaceBuilder = NO; [self setVersion: 0]; } } - -- (id)nibInstantiate -{ - if (_realObject == nil) - { - Class aClass = NSClassFromString(_className); - if (aClass == nil) - { - [NSException raise: NSInternalInconsistencyException - format: @"Unable to find class '%@'", _className]; - } - else - { - _realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]]; - [[self superview] replaceSubview: self with: _realObject]; // replace the old view... - } - } - - return _realObject; -} @end // Template for any classes which derive from NSMenu.