Files
agila-learning-examples/tl/objectivec-practice-20261101/lesson-1/main.m
T

15 lines
447 B
Objective-C

#import <Foundation/Foundation.h>
#include <stdio.h>
#include <assert.h>
int main(void) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *minutes = [NSArray arrayWithObjects:
[NSNumber numberWithInt:1], [NSNumber numberWithInt:2], [NSNumber numberWithInt:3], nil];
int total = 0;
for (NSNumber *value in minutes) total += [value intValue];
printf("%d\n", total);
[pool drain];
return 0;
}