NSSavePanel, CGImageDestinationFinalize and OS X sandbox
问题 I'm using NSSavePanel to let user select image to save to in my app. Everything worked fine until I enabled app sandboxing and entitlements. The problem occurs with selection of an already existing file. My code is like this: // Create a URL to our file destination and a CGImageDestination to save to. CGImageDestinationRef imageDestination = CGImageDestinationCreateWithURL((CFURLRef)[savePanel URL], (CFStringRef)newUTType, 1, NULL); CGImageDestinationAddImage(imageDestination, cgimage,