ScratchPad
Check if two NSURLs point to the same file.

Using -isEqual: is a great way to detect if two NSURLs are equal. But this approach won’t work if you need to know if the two URLs point to the same file, like in this case:

/var/some/path
/private/var/some/path

In OS X 10.7 and iOS 5 Apple added a new key (NSURLFileResourceIdentifierKey) to NSURL that makes implementing this check pretty straightforward:

- (BOOL)mn_identicalFileAtURL:(NSURL *)aURL
{
    id fileURLID1;
    [self getResourceValue:&fileURLID1 forKey:NSURLFileResourceIdentifierKey error:NULL];

    id fileURLID2;
    [aURL getResourceValue:&fileURLID2 forKey:NSURLFileResourceIdentifierKey error:NULL];

    if (!fileURLID1 || !fileURLID2) return NO; // no file URLs?

    return ([fileURLID1 isEqual:fileURLID2]);
}

mosx:

This script opens up a lot of possibilities for exporting tasks out of OmniFocus to a lot of other apps. In my case this app is MindNode.

The script above was originally written by RobTrew and modified by Shotster and me. Shotster added string replacements and added some mandatory entities to…

ornyx:

Its been about 3 weeks, but I’m finally done with a piece of work that will be used (hopefully) in the iCloud capable version of Mindnode.

MNCoder is what I’d call a clever hack using NSKeyedArchiver and NSKeyedUnarchiver to help with portability of certain Apple classes between iOS and…

IdeasOnCanvas Scratch Pad

A more developer and entrepreneur centric view on IdeasOnCanvas.