Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 3, 2013, 07: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, 08: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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:08 AM.

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

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