The code you posted will not work with or without ARC, because before you pass it, you need to expand the tilde in the path name.
The code you provided also had leaks of elements returned by CGDisplayCreateImage and CGImageDestinationCreateWithURL . Here is an example that works and does not leak:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { CGDirectDisplayID displayID = CGMainDisplayID(); CGImageRef imageRef = CGDisplayCreateImage(displayID);
jlehr source share