User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

intValue

 
- (int)intValue;
 

Returns the receiver’s value.

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

ObjC Sourcecode Example

    //** Sample Datatype **
    int myInt = 30;
 
    //** Initializing NSNumber Object **
    NSNumber *myIntNumber = [[NSNumber alloc]initWithInt:myInt];
 
    //**  To access your value use intValue **
    if ([myIntNumber intValue] == 30) {
 
        NSLog(@"myIntNumber: %@", myIntNumber);
        NSLog(@"myInt: %i", [myIntNumber intValue]);
 
    }

Output for this example code

2012-07-01 15:06:42.650 NSNumberSample[281:f803] myIntNumber: 30
2012-07-01 15:06:42.652 NSNumberSample[281:f803] myInt: 30
advertising
objective-c/foundation.framework/nsnumber.h/intvalue.txt · Last modified: 2012/12/20 12:24 (external edit)

Impressum Datenschutz