User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsnumber.h:boolvalue

boolValue

 
- (BOOL)boolValue;
 

Returns the receiver’s value.

Return Value - The receiver’s value as datatyp, converting it as necessary.

ObjC Sourcecode Example

    //** Sample Datatype **
    BOOL myBool = NO;
 
    //** Initializing NSNumber Object **
    NSNumber *myBoolNumber = [[NSNumber alloc]initWithBool:myBool];
 
    //**  To access your value use boolValue **
    if ([myBoolNumber boolValue] == NO) {
 
        NSLog(@"myBoolNumber: %@", myBoolNumber);
        NSLog(@"myBool: %i", [myBoolNumber boolValue]);
 
    }

Output for this example code

2012-06-03 18:40:00.105 NSNumberSample[500:f803] myBoolNumber: 0
2012-06-03 18:40:00.107 NSNumberSample[500:f803] myBool: 0
advertising
objective-c/foundation.framework/nsnumber.h/boolvalue.txt · Last modified: 2012/12/20 12:24 (external edit)

Impressum Datenschutz