User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

doubleValue

 
- (double)doubleValue;
 

Returns the receiver’s value.

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

ObjC Sourcecode Example

    //** Sample Datatype **
    double myDouble = 3.14;
 
    //** Initializing NSNumber Object **
    NSNumber *myDoubleNumber = [[NSNumber alloc]initWithDouble:myDouble];
 
    //**  To access your value use doubleValue **
    if ([myDoubleNumber doubleValue] == 3.14) {
 
        NSLog(@"myDoubleNumber: %@", myDoubleNumber);
        NSLog(@"myDouble: %f", [myDoubleNumber doubleValue]);
 
    }

Output for this example code

2012-07-01 15:14:58.563 NSNumberSample[320:f803] myDoubleNumber: 3.14
2012-07-01 15:14:58.564 NSNumberSample[320:f803] myDouble: 3.140000
advertising
objective-c/foundation.framework/nsnumber.h/doublevalue.txt · Last modified: 2012/12/20 12:24 (external edit)

Impressum Datenschutz