User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

charValue

 
- (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
advertising
objective-c/foundation.framework/nsnumber.h/charvalue.txt · Last modified: 2012/12/20 12:24 (external edit)

Impressum Datenschutz