Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OP here. </p> <p>I managed to fix it. I made it a bit more abstract, and lengthened out every method as much as I could so I could see it step by step. Thought I'd post up my fix for anyone else who stumbles upon my question.</p> <p>Here is the end code for the move file section in .m:</p> <pre><code>- (IBAction)moveFile:(id)sender { if (topButtonClicked == YES) { //Take in picture CFURLRef CFURLReftheDoc = (__bridge CFURLRef)theDoc; CGImageSourceRef myImageSource = CGImageSourceCreateWithURL(CFURLReftheDoc, NULL); //Create a reference to the image itself, take in the image read, which image (only one, so 0), and additional options. CGImageRef imageItself = CGImageSourceCreateImageAtIndex(myImageSource, 0, NULL); //Save picture to desktop //Store desktop directory. NSString *path = [@"~/Desktop/public.png" stringByExpandingTildeInPath]; NSURL *NSURLdesktopURL = [[NSURL alloc] initFileURLWithPath:path]; NSLog(@"%@",NSURLdesktopURL); //store where I want to save, the type of file I expect to save, number of images to save, any additional options. CGImageDestinationRef whereToSave = CGImageDestinationCreateWithURL((__bridge CFURLRef)NSURLdesktopURL, kUTTypeJPEG, 1, NULL); // NSLog(@"%@",whereToSave); //Begin final preperations, pull altogether desktop URL, the image read in before, and additional options. CGImageDestinationAddImage (whereToSave, imageItself, NULL); //Finalize (write the file) CGImageDestinationFinalize(whereToSave); //CGImageDestinationRef saveImageToDesktop (CFURLRef desktop, CFStringRef jpeg, size_t count, CFDictionaryRef NULL); } else{ /* open an alert with an OK button */ NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"Stop it."]; [alert runModal]; } } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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