Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 3, 2013, 08:46 PM   #1
Fuzzball27
macrumors newbie
 
Join Date: Aug 2011
CGPDFDocumentRef issue

I'm missing something obvious here, but I can't remember what...

Can someone explain to me why when I log "url" it comes out as expected, and when I create "document" I get error code -15?

Code:
NSString *filePathString = [filePath stringValue];
    CFStringRef URLString = (CFStringRef)CFBridgingRetain(filePathString);
    CFStringRef URLStringEscaped = CFURLCreateStringByAddingPercentEscapes(NULL, URLString, NULL, NULL, kCFStringEncodingUTF8);
    CFURLRef url = CFURLCreateWithString(kCFAllocatorDefault, URLStringEscaped, NULL);
    NSLog(@"%@", url);
    CGPDFDocumentRef document = CGPDFDocumentCreateWithURL(url);
Thanks!
Fuzzball27 is offline   0 Reply With Quote
Old Jan 3, 2013, 09:05 PM   #2
Fuzzball27
Thread Starter
macrumors newbie
 
Join Date: Aug 2011
Got it

I figured it out:
I should have been using "CFURLCreateWithFileSystemPath" not "CFURLCreateWithString"
Fuzzball27 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iOS 7 Orientation Issue - Hardware or Software Issue? GandalfBR iOS 7 6 Nov 16, 2013 05:56 PM
Hardware issue? Software issue? SSD beginning to die? oneMadRssn MacBook Air 11 Jun 5, 2013 01:00 PM
Font rendering issue with rMBP (Macbook issue or website issue?) Vinterbird MacBook Pro 8 Feb 27, 2013 11:42 AM
So has the Wi-Fi issue been determined to be a hardware issue or software issue? 1080p iPhone 0 Sep 25, 2012 01:11 AM
Macbook Pro Backlight Issue will swapping Display solve issue? Kayla90 MacBook Pro 4 Aug 24, 2012 02:38 PM

Forum Jump

All times are GMT -5. The time now is 06:37 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC