* 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
This commit is contained in:
gcasa 2008-11-22 04:07:50 +00:00
parent c9f2a70cf9
commit 00d73826fd
2 changed files with 29 additions and 42 deletions

View file

@ -1,7 +1,12 @@
2008-11-21 23:12-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSNibCompatibility.m: Remove calls to designated initializers
for nib files.
2008-11-21 01:12-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSNibTemplates.m: Remove calls to designated initializers
as per documentation.
for gorm files as per documentation.
2008-11-20 Wolfgang Lux <wolfgang.lux@gmail.com>

View file

@ -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.