Shiki

I'm so bad with words that I can't even make a cool tagline

Author Archives: Shiki

Using an object’s id as a key in NSDictionary

I was working on a utility class and was playing with the idea of using the id of an object (e.g. NSObject) as a key in NSDictionary. Setting it directly doesn’t work though: NSObject *obj = [[[NSObject alloc] init] autorelease]; // we’ll use this as the key NSMutableDictionary *dict = [[[NSMutableDictionary alloc] init] autorelease]; [dict [...]

Installing GraphicsMagick and Gmagick PHP extension on CentOS 5.6

This was tested on CentOS 5.6 on a fresh MediaTemple (dv) setup. I figure it should be the same for any CentOS install. This set of instructions is a result of hours spent on installation troubleshooting; google searches; and trial and errors. Hopefully this can help other people. Install dependencies These are needed to enable [...]

Core Data error: Unsupported expression type (11, SIZE)

Yeah, so I’ve been learning Core Data and I keep getting this error during a fetch request: Name: NSInvalidArgumentException File: Unknown Line: Unknown Reason: Unsupported expression type (11, SIZE) An obscure error message, yay! This happened when I used this very simple predicate declaration: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"size == %@", @"medium"]; Like one of [...]