Tag Archives: Objective C

CocoaTouch, CoreData and binary String Search

The query optimiser for NSPredicate queries ontop CoreData/SQLite on the iPhone is a bit rudimentary (cough) and so I had to optimise myself to get binary-search enabled quick results:

Cocoa wrapped regex.h

Strange enough there’s no regular expression class in the iPhone SDK. Update: iOS 4 brings NSRegularExpression. My simple wrapper around the regex.h C API is not safe for unicode matching patterns but does the job e.g. for parsing URLs. If you need more, have a look at RegexKitLite. My simple wrapper has the interface:

NSDateFormatter & Http Header

A.S. Update 2, License: as I’ve been asked about which license this code is under: I put this into Public Domain. No warranty whatsoever. Still I’d be happy about attribution but don’t require such. Ever tried to get e.g. the „Last-Modified“ HTTP response header field into a NSDate object? That’s no real fun, because this […]

Unit Testing / iPhone

Having Eclipse & JUnit in mind I missed unit testing quite a bit while developing with XCode for iPhone. As a first shot, I set SenTestingKit up as explained by it’s author and it works really nicely. One thing I still miss is Step’n’Trace debugging the tests. Other intros to the topic from Apple about […]

NSURLCache Joke / iPhone

Did you ever wonder why Apple’s own Demo App URLCache doesn’t use the NSURLCache class, but rather reimplements disk caching instead? Well, it looks like NSURLCache promises disk-caching, but doesn’t keep this promise.

NSURLConnection gzip magic

For quite some time I ranted about not being able to use compressed network communcation out-of-the-box on the iPhone. Despite being undocumented (or I just overlooked the hint), NSURLConnection does gzip decompression transparently! That’s how to use it:

CoreData – Hello World.

CoreData ist im iPhone OS 3.0 ganz frisch dazugekommen und riecht auch noch ein wenig nach Plastik. Leider ist der Beispielcode auf den Apple auch im iPhone CoreData Tutorial immer wieder verweist (Locations Sample Project) dem Umzug der OS 3.0 beta um Opfer gefallen. Also los geht’s zum ersten Schritt:

Objective C geht bei den Buchverkäufen

ab wie Schmitts Katze. Sieh an, sieh an.