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.
//** 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]); }
2012-07-01 15:41:52.009 NSNumberSample[528:f803] myCharNumber: 119 2012-07-01 15:41:52.010 NSNumberSample[528:f803] myChar: w