mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
MacOS-X compatibility fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20274 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b65f2e35c7
commit
c8aae944a4
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-10-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSUserDefaults.m: ([setObject:forKey:]) when given a nil
|
||||||
|
value to set, remove any existing object for the key. Fix for
|
||||||
|
MacOS-X compatibility (bug #10743).
|
||||||
|
|
||||||
2004-10-29 Matt Rice <ratmice@yahoo.com>
|
2004-10-29 Matt Rice <ratmice@yahoo.com>
|
||||||
|
|
||||||
* Source/Additions/GSObjCRuntime.m (GSObjCAllSubclassesOfClass,
|
* Source/Additions/GSObjCRuntime.m (GSObjCAllSubclassesOfClass,
|
||||||
|
|
|
@ -1194,23 +1194,23 @@ static BOOL isPlistObject(id o)
|
||||||
* if this is the first change to a persistent-domain since the
|
* if this is the first change to a persistent-domain since the
|
||||||
* last -synchronize.
|
* last -synchronize.
|
||||||
* </p>
|
* </p>
|
||||||
|
* If value is nil, this is equivalent to the -removeObjectForKey: method.
|
||||||
*/
|
*/
|
||||||
- (void) setObject: (id)value forKey: (NSString*)defaultName
|
- (void) setObject: (id)value forKey: (NSString*)defaultName
|
||||||
{
|
{
|
||||||
NSMutableDictionary *dict;
|
NSMutableDictionary *dict;
|
||||||
id obj;
|
id obj;
|
||||||
|
|
||||||
|
if (value == nil)
|
||||||
|
{
|
||||||
|
[self removeObjectForKey: defaultName];
|
||||||
|
}
|
||||||
if ([defaultName isKindOfClass: [NSString class]] == NO
|
if ([defaultName isKindOfClass: [NSString class]] == NO
|
||||||
|| [defaultName length] == 0)
|
|| [defaultName length] == 0)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"attempt to set object with bad key (%@)", defaultName];
|
format: @"attempt to set object with bad key (%@)", defaultName];
|
||||||
}
|
}
|
||||||
if (value == nil)
|
|
||||||
{
|
|
||||||
[NSException raise: NSInvalidArgumentException
|
|
||||||
format: @"attempt to set nil object for key (%@)", defaultName];
|
|
||||||
}
|
|
||||||
if (isPlistObject(value) == NO)
|
if (isPlistObject(value) == NO)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
|
Loading…
Reference in a new issue