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

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsnumber.h/boolvalue.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz