Monthly Archives: December 2008

FMDB: Easy SQLite database wrapper

One of the difficulties in iPhone is that it lacks Core Data, thus requiring developers to handle the database directly. While the system has SQLite built in (in libsqlite3.0.dylib ), the functions just beg to be wrapped up into something … Continue reading

Posted in Uncategorized | Leave a comment

Precision Math in Cocoa: NSDecimalNumber

Arithmetic underflow and the 2′s compliment representation of numbers is serious problems in writing algorithms, especially when dealing with financial transactions. A lot of developers skirt around this problem by using double precision, but that is asking for trouble in … Continue reading

Posted in Uncategorized | Leave a comment

Callable Objects in Cocoa: NSInvocation

In Java 5 the java.util.concurrent.Callable interface was introduced. This is a generic interface that works like a Runnable, except that it returns a value and can throw checked exceptions. Using Cocoa, we have a tool that can be used for … Continue reading

Posted in Uncategorized | Leave a comment

Logging

The Cocoa framework provides a function called NSLog and the somewhat lesser known NSLogv. Coming from a Java and a Python background, where I have good loggers (Log4J and java.util.logging in Java, and the logging module in Python), I wanted … Continue reading

Posted in Uncategorized | Leave a comment

Moving around Excel efficiently in code

Let’s face it, Excel is horrible at iteration over cells. Somewhat like in Matlab where a loop over entries will kill your processing time, you don’t want to move from cell to cell reading information and processing unless you have … Continue reading

Posted in Uncategorized | Leave a comment

Telling a Story

When I first got out of school I received two pieces of advice from several different sources: You are interviewing them as much as they are interviewing you Tell a story in the interview Both of these points are obvious … Continue reading

Posted in Uncategorized | Leave a comment

Categories: Modifying Existing Classes in Objective-C

One of the more interesting features of some scripting languages is the programmer’s ability to modify existent–and sometimes even built-in–classes. It can be used to segment functionality in a large class, split source for one class between several files, and … Continue reading

Posted in Uncategorized | Leave a comment

Patterns in Python: Strategy

With all the posts about Objective-C and design patterns lately that David’s been posting, it’s only fair that we bring back some of it to Python with some simple patterns. So, let’s  steal the strategy pattern post today! Subscribe to … Continue reading

Posted in Uncategorized | Leave a comment

iPhone Startup Splash Screen

This tip comes from iPhoneDeveloperTips. To create a splash screen that will come up while your application is loading (as opposed to blackness), create a PNG named Default.png and put it in the top directory of your Resources bundle. Done, … Continue reading

Posted in Uncategorized | Leave a comment

Fetching the Application Delegate

When developing for the Mac or the iPhone we frequently run into the situation of needing to grab the delegate.  Thankfully this is stored in a singleton object and very easy to fetch: 1 2 3 #import "MyAppDelegate.h" … MyAppDelegate … Continue reading

Posted in Uncategorized | Leave a comment