First i selected images from photo library to ALAsset Library and after that i stored images in document directory from ALAsset library path.
i am using this code to
You can get all the image files from the Document Directory this way:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSArray *filePathsArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:documentsDirectory error:nil];
NSMutableArray *imgFiles = [[NSMutableArray alloc] init];
for (int i=0; i
And then you can display the images into the UITableView
like this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 50, 50)];
img.image = [UIImage imageWithContentsOfFile:[imgFiles objectAtIndex:indexPath.row]];
[cell addSubview:img];
return cell;
}
Cheers!!!