Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Replace </p> <pre><code>// define the block to call when we get the asset based on the url (below) ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *imageAsset) { ALAssetRepresentation *imageRep = [imageAsset defaultRepresentation]; CGImageRef iref = [imageRep fullResolutionImage]; if (iref) { self.galleryImage = [UIImage imageWithCGImage:iref]; } NSLog(@"[imageRep filename] : %@", [imageRep filename]); NSLog(@"[imageRep image] : %@", galleryImage); }; </code></pre> <p>with </p> <pre><code>// define the block to call when we get the asset based on the url (below) ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *imageAsset) { ALAssetRepresentation *imageRep = [imageAsset defaultRepresentation]; CGImageRef iref = [imageRep fullResolutionImage]; if (iref) { self.galleryImage = [UIImage imageWithCGImage:iref]; } [self.tableView reloadData]; //Reload the tableView. NSLog(@"[imageRep filename] : %@", [imageRep filename]); NSLog(@"[imageRep image] : %@", galleryImage); }; </code></pre> <h1>EDITED:</h1> <h1>A.m</h1> <pre><code>@interface A () @property(nonatomic,strong) B *b; @end @implementation b -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { if(self.b) { // Initialize View Controller B self.b = [[B alloc]initWithNibName:@"PhotosListViewController" bundle:nil]; } // get the ref url NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL]; self.b.test = imageURL; NSLog(@"%@",imageURL); [picker dismissViewControllerAnimated:YES completion:nil]; [self.navigationController pushViewController:self.b animated:YES]; } - (IBAction)organiseAttachement:(id)sender { if(self.b == nil) { // Initialize View Controller self.b = [[PhotosListViewController alloc]initWithNibName:@"B" bundle:nil]; } [self.navigationController pushViewController:self.b animated:YES]; } @end </code></pre>
    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.
    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