User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

floatValue

 
- (float)floatValue;
 

Returns the receiver’s value.

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

ObjC Sourcecode Example

    //** Sample Datatype **
    float myFloat = 1.123456f;
 
    //** Initializing NSNumber Object **
    NSNumber *myFloatNumber = [[NSNumber alloc]initWithFloat:myFloat];
 
    //**  To access your value use floatValue **
    if ([myFloatNumber floatValue] == 1.123456f) {
 
        NSLog(@"myFloatNumber:%@", myFloatNumber);
        NSLog(@"myFloat: %f", [myFloatNumber floatValue]);
 
    }

Output for this example code

2012-07-01 15:23:05.981 NSNumberSample[402:f803] myFloatNumber:1.123456
2012-07-01 15:23:05.983 NSNumberSample[402:f803] myFloat: 1.123456
advertising
objective-c/foundation.framework/nsnumber.h/floatvalue.txt · Last modified: 2012/12/20 12:24 (external edit)

Impressum Datenschutz