Wednesday, 5 October 2011

Accessing specific folder files in iphone app

Accessing specific folder files
1. add folder with the second radio button
2. it is located at anyname.app/yourfolder


NSString *bundleRoot1 = [[NSBundle mainBundle] resourcePath];
    bundleRoot1=[bundleRoot1 stringByAppendingString:@"/Images"];
    NSArray *dirContents1 = [[NSFileManager defaultManager] directoryContentsAtPath:bundleRoot1];
    NSLog(@"dirContents1 %@",dirContents1);
   
    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:[dirContents1 objectAtIndex:0]]]];

No comments:

Post a Comment