jspahrsummers/libextobjc — pull request #28 by BB9z (2013-04-25 03:55:49+00:00)
Title: Add @keypathClassInstance()

We use @keypath a lot in our project, sometime we write code like this:

```Objective-C
Channel *obj = nil;
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Channel"];
request.predicate = [NSPredicate predicateWithFormat:@"%K = %@", @keypath(obj, code), code];
```

The pain point was we must define a instance before to let @keypath generate a instance keypath.

So I made @keypathClassInstance to solve that. Now we can write like this:

```Objective-C
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Channel"];
request.predicate = [NSPredicate predicateWithFormat:@"%K = %@", @keypathClassInstance(Channel, code), code];
```

You may edit the document, as English not my native.