Saturday, April 20, 2013

List in Objective-C

void demoArray()
{
    @autoreleasepool {
        
        NSMutableArray *items = [NSMutableArray array];
        
        [items addObject: [NSNumber numberWithInteger:42]];
        
        [items addObject: [NSNumber numberWithInteger:11]];
        [items addObject: [NSNumber numberWithInteger:5]];
        [items addObject: [NSNumber numberWithInteger:1976]];
        
        
        for(NSNumber *number in items) {
            printf("\n%d", number.intValue);
        }
    
    }
}

No comments:

Post a Comment