Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display all images from NSDocument directory
    primarykey
    data
    text
    <p>First i selected images from photo library to ALAsset Library and after that i stored images in document directory from ALAsset library path.</p> <p>i am using this code to store images in document directory from ALAsset Library.... Its working perfect... Now i want to display all images which are stored in document directory in table view.. how can i do this??? can anybody help me??</p> <p><strong>Code for importing images from ALAsset Library to NSdocument directory</strong></p> <pre><code>for (int j=0; j&lt;[assetArray count]; j++) { ALAssetRepresentation *representation = [[assetArray objectAtIndex:j] defaultRepresentation]; NSString* filename = [documentPath stringByAppendingPathComponent:[representation filename]]; [[NSFileManager defaultManager] createFileAtPath:filename contents:nil attributes:nil]; NSOutputStream *outPutStream = [NSOutputStream outputStreamToFileAtPath:filename append:YES]; [outPutStream open]; long long offset = 0; long long bytesRead = 0; NSError *error; uint8_t * buffer = malloc(131072); while (offset&lt;[representation size] &amp;&amp; [outPutStream hasSpaceAvailable]) { bytesRead = [representation getBytes:buffer fromOffset:offset length:131072 error:&amp;error]; [outPutStream write:buffer maxLength:bytesRead]; offset = offset+bytesRead; } [outPutStream close]; free(buffer); </code></pre> <p>}</p> <p>After that i got the contents of directory using this code:</p> <pre><code> NSFileManager *manager = [NSFileManager defaultManager]; fileList = [manager directoryContentsAtPath:newDir]; </code></pre> <p>Its also working... but now when i want to display images from document directory. It doesn't show anything....</p> <pre><code> setImage.image=[UIImage imageNamed:[filePathsArray objectAtIndex:0]]; </code></pre> <p>Can anybody help, where is the problem????? - I have one doubt: *Is it the right way to import images from ALAsset Library to document directory???</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload