Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to know image present at the url
    primarykey
    data
    text
    <p>I have url for image picked using <code>ELCImagePickerController</code>. I stored the url for future reference.</p> <p>I get that URL using:</p> <pre><code>[dict valueForKey:UIImagePickerControllerReferenceURL]; </code></pre> <p>Now the problem arises when after some time user deleted that particular image from photo library and I am going to access that image using URL. My app does not get crashed.</p> <p>I have tried using NSUrl method</p> <pre><code>[imagePath checkResourceIsReachableAndReturnError:&amp;err] </code></pre> <p>as well i tried something like:</p> <pre><code>-(BOOL)findImage:(NSURL*)path { dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); __block BOOL flag=YES; ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentation *rep = [myasset defaultRepresentation]; CGImageRef iref = [rep fullScreenImage]; if (iref) { flag=YES; dispatch_group_leave(group); } }; ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror) { NSLog(@"cant get image - %@",[myerror localizedDescription]); flag=NO; }; ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init]; [assetslibrary assetForURL:path resultBlock:resultblock failureBlock:failureblock]; dispatch_group_wait(group, DISPATCH_TIME_FOREVER); dispatch_release(group); [assetslibrary release]; return flag; } </code></pre> <p>Sample url : </p> <pre><code>assets-library://asset/asset.JPG?id=E862927E-E646-448A-9EB6-A7D48668B3DC&amp;ext=JPG </code></pre> <p>But no success.</p> <p>How to know that image present at particular URL.</p> <p>If any one can help me out on this will be appreciable.</p> <p>Thanks in advance.</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