Shiki

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

Category Archives: Objective-C

Offline maps in iOS using OpenStreetMap and Route-Me

This tutorial is heavily based on Rupert’s article here. However, the steps in this article are very different on some points. There are some steps that I had to figure out using other sources. Generating OpenStreetMap tiles database We’re going to use downloadosmtiles.pl to download OSM tiles for a specific region. Download, compile, and install [...]

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 [...]

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 [...]