discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumber numberWithBool


From: Sebastian Reitenbach
Subject: NSNumber numberWithBool
Date: Fri, 08 Jun 2007 21:08:39 +0200

Hi,

while trying to get opengroupware running with gnustep-base I stumbled about 
the different return values of +NSNumber numberWithBool.
Running the following test tool:
#include <Foundation/Foundation.h>

int main (int argc, char **argv) {
        NSLog(@"numberWithInt: %@, numberWithBool: %@", [NSNumber 
numberWithInt:YES], [NSNumber numberWithBool:YES]);
        NSLog(@"numberWithInt: %@, numberWithBool: %@", [NSNumber 
numberWithInt:NO], [NSNumber numberWithBool:NO]);
        return 0;
}

produces this output, if compiled against gnustep-base:
2007-06-08 20:46:56.843 numbertest2[12538] numberWithInt: 1, numberWithBool: 
YES
2007-06-08 20:46:56.844 numbertest2[12538] numberWithInt: 0, numberWithBool: 
NO

and this, when compiled against libFoundation:
Jun 08 20:46:10 numbertest2 [13059]: numberWithInt: 1, numberWithBool: 1
Jun 08 20:46:10 numbertest2 [13059]: numberWithInt: 0, numberWithBool: 0

who is right, both? unfortunately I do not have a mac where I could check 
out what happens there. Cocoa dev docs are not that helpful to me:

numberWithBool:
Creates and returns an NSNumber object containing a given value, treating it 
as a BOOL.
+ (NSNumber *)numberWithBool:(BOOL)value


kind regards
Sebastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]