www.pudn.com > property_test_1.zip > main.m, change:2013-05-10,size:801b


//
//  main.m
//  property_test_1
//
//  Created by Admin on 13-5-10.
//  Copyright (c) 2013年 Admin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Car.h"
#import "Slant6.h"
#import "AllWeatherRadial.h"

int main (int argc, const char * argv[])
{
	NSAutoreleasePool *pool;
	pool = [[NSAutoreleasePool alloc] init];
	
	Car *car = [[Car alloc] init];
	car.name = @"Herbie";
	
	int i;
	for (i = 0; i < 4; i++) {
		AllWeatherRadial *tire;
		
		tire = [[AllWeatherRadial alloc] init];
		[tire setRainHandling: 20 + i];
		[tire setSnowHandling: 28 + i];
		
		[car setTire: tire
			 atIndex: i];
		
		[tire release];
	}
	
	Slant6 *engine = [[Slant6 alloc] init];
	car.engine = engine;
	
	[engine release];
	
	[car print];
	[car release];
	
	[pool release];
	
	return (0);
	
} // main