User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

Q&A is closed



- (char)charValue;

Returns the receiver’s value.

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

ObjC Sourcecode Example

    //** Sample Datatype **
    char myChar = 'w';
    //** Initializing NSNumber Object **
    NSNumber *myCharNumber = [[NSNumber alloc]initWithChar:myChar];
    //**  To access your value use charValue **
    if ([myCharNumber charValue] == 'w') {
        NSLog(@"myCharNumber: %@", myCharNumber);
        NSLog(@"myChar: %c", [myCharNumber charValue]);

Output for this example code

2012-07-01 15:41:52.009 NSNumberSample[528:f803] myCharNumber: 119
2012-07-01 15:41:52.010 NSNumberSample[528:f803] myChar: w

on the occasion of the current invasion of Russia in Ukraine

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

Impressum Datenschutz