mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-28 11:00:46 +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
|
@ -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>
|
2008-11-21 01:12-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/GSNibTemplates.m: Remove calls to designated initializers
|
* 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>
|
2008-11-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -455,26 +455,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
_className = [coder decodeObjectForKey: @"NSClassName"];
|
_className = [coder decodeObjectForKey: @"NSClassName"];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[NSException raise: NSInvalidArgumentException
|
|
||||||
format: @"Can't decode %@ with %@.",NSStringFromClass([self class]),
|
|
||||||
NSStringFromClass([coder class])];
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) encodeWithCoder: (NSCoder *)coder
|
|
||||||
{
|
|
||||||
if ([coder allowsKeyedCoding])
|
|
||||||
{
|
|
||||||
[coder encodeObject: (id)_className forKey: @"NSClassName"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) nibInstantiate
|
|
||||||
{
|
|
||||||
if (_realObject == nil)
|
if (_realObject == nil)
|
||||||
{
|
{
|
||||||
Class aClass = NSClassFromString(_className);
|
Class aClass = NSClassFromString(_className);
|
||||||
|
@ -485,12 +466,28 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]];
|
_realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithCoder: coder];
|
||||||
[[self superview] replaceSubview: self with: _realObject]; // replace the old view...
|
[[self superview] replaceSubview: self with: _realObject]; // replace the old view...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _realObject;
|
return _realObject;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"Can't decode %@ with %@.",NSStringFromClass([self class]),
|
||||||
|
NSStringFromClass([coder class])];
|
||||||
|
}
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) encodeWithCoder: (NSCoder *)coder
|
||||||
|
{
|
||||||
|
if ([coder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
[coder encodeObject: (id)_className forKey: @"NSClassName"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// setters and getters
|
// setters and getters
|
||||||
|
@ -508,6 +505,11 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
return _realObject;
|
return _realObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) nibInstantiate
|
||||||
|
{
|
||||||
|
return [self realObject];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// Template for any classes which derive from NSText
|
// Template for any classes which derive from NSText
|
||||||
|
@ -530,26 +532,6 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
[self setVersion: 0];
|
[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
|
@end
|
||||||
|
|
||||||
// Template for any classes which derive from NSMenu.
|
// Template for any classes which derive from NSMenu.
|
||||||
|
|
Loading…
Reference in a new issue