User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

Q&A is closed



- (id)initWithInteger:(NSInteger)value NS_AVAILABLE(10_5, 2_0);

ObjC Sourcecode Example

    NSInteger myInteger = 20;
    //******************** Initializing NSNumber Object *************************
    //** NSNumbers need to be released, if you`re not working with ARC! **
    NSNumber *myIntegerNumber = [[NSNumber alloc]initWithInteger:myInteger];
    NSLog(@"myIntegerNumber: %@", myIntegerNumber);

Output for this example code

2012-08-31 22:37:05.699 NSNumberSample[808:f803] myIntegerNumber: 20

on the occasion of the current invasion of Russia in Ukraine

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

Impressum Datenschutz