mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 18:20:36 +00:00
* 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:
parent
c9f2a70cf9
commit
00d73826fd
2 changed files with 29 additions and 42 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue