cocoaTouch/HogHatViewController.m
changeset 3316 52f0482b043f
parent 3315 4e2813713358
child 3317 198ec44b6d92
--- a/cocoaTouch/HogHatViewController.m	Tue Apr 06 21:54:46 2010 +0000
+++ b/cocoaTouch/HogHatViewController.m	Wed Apr 07 01:22:05 2010 +0000
@@ -25,9 +25,10 @@
     // load all the hat images from the previous array but save only the first sprite and store it in hatSprites
     NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[hatArray count]];
     for (int i=0; i< [hatArray count]; i++) {
-        NSString *hatFile = [hatPath stringByAppendingString:[hatArray objectAtIndex:i]];
+        NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/Data/Graphics/Hats/%@",[[NSBundle mainBundle] resourcePath],[hatArray objectAtIndex:i]];
         
         UIImage *image = [[UIImage alloc] initWithContentsOfFile: hatFile];
+        [hatFile release];
         CGRect firstSpriteArea = CGRectMake(0, 0, 32, 32);
         CGImageRef cgImgage = CGImageCreateWithImageInRect([image CGImage], firstSpriteArea);
         [image release];