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

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsnumber.h/intvalue.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz