cocoaTouch/SingleTeamViewController.m
changeset 3316 52f0482b043f
parent 3315 4e2813713358
child 3323 091cf214bdd5
equal deleted inserted replaced
3315:4e2813713358 3316:52f0482b043f
    58     NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[hogArray count]];
    58     NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[hogArray count]];
    59     for (NSDictionary *hog in hogArray) {
    59     for (NSDictionary *hog in hogArray) {
    60         NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/Data/Graphics/Hats/%@.png",[[NSBundle mainBundle] resourcePath],[hog objectForKey:@"hat"]];
    60         NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/Data/Graphics/Hats/%@.png",[[NSBundle mainBundle] resourcePath],[hog objectForKey:@"hat"]];
    61 
    61 
    62         UIImage *image = [[UIImage alloc] initWithContentsOfFile: hatFile];
    62         UIImage *image = [[UIImage alloc] initWithContentsOfFile: hatFile];
       
    63         [hatFile release];
    63         CGRect firstSpriteArea = CGRectMake(0, 0, 32, 32);
    64         CGRect firstSpriteArea = CGRectMake(0, 0, 32, 32);
    64         CGImageRef cgImgage = CGImageCreateWithImageInRect([image CGImage], firstSpriteArea);
    65         CGImageRef cgImgage = CGImageCreateWithImageInRect([image CGImage], firstSpriteArea);
    65         [image release];
    66         [image release];
    66         
    67         
    67         UIImage *hatSprite = [[UIImage alloc] initWithCGImage:cgImgage];
    68         UIImage *hatSprite = [[UIImage alloc] initWithCGImage:cgImgage];