Re: strange behaviour?

Richard Frith-Macdonald <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
On 21 Jan 2005, at 20:05, Christian Klein wrote:

> Hello,
>
> I have this piece of code in my little test application:
>
>     NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
>     if([ud objectForKey: @"NSWriteOldStylePropertyLists"] == NO)
>         NSLog(@"returned NO\n");
>     else
>         NSLog(@"returned YES\n");
>
>     if(GSMacOSXCompatiblePropertyLists() == NO)
>         NSLog(@"returned NO\n");
>     else
>         NSLog(@"returned YES\n");
>
> and my GNUstepDefaults looks like this:
> {
>     NSGlobalDomain = {
>                 NSWriteOldStylePropertyLists = 0;
>     };
> }
>
>
> when the code above runs, it outputs:
> 2005-01-21 20:57:57.000 ab[61277] returned YES
> 2005-01-21 20:57:57.000 ab[61277] returned NO
>
> Shouldn't the result be the same?

I think it's a bug in your code ... you meant to use boolForKey:, but 
actually used objectForKey:
The program output is what I would expect to see.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.