Friday, 24 February 2012

Getting particular named images from the project + iphone

NSMutableArray *any=[[NSMutableArray alloc] init];
    NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
    NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:bundleRoot];
    for (NSString *tString in dirContents) {
        if ([tString hasPrefix:@"Fire Type1"] && [tString hasSuffix:@".png"]) {
           
            [any addObject:tString];
           
        }
    }
    NSLog(@"%@",any);

No comments:

Post a Comment