-
Recent Posts
Recent Comments
- Michael Dorf on I’m an Engineer, Not a Compiler
- fangbianmian on I’m an Engineer, Not a Compiler
- Ratking on I’m an Engineer, Not a Compiler
- quess on I’m an Engineer, Not a Compiler
- Hugo Estrada on I’m an Engineer, Not a Compiler
Archives
Categories
Meta
Author Archives: dclements
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
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
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
Patterns in Objective-C: Strategy Pattern using Forwarding
When working with the Observer Pattern and the Singleton Pattern it is easy to see how they relate to the Java or C++ versions of the same concept. Everything basically plugs into the same places you would expect, coming from … Continue reading
Posted in Uncategorized
Leave a comment
Variable Arguments (varargs) in Objective-C
Creating variable argument functions (also vararg or variadic function) in Objective-C is done the same way that it is done in C, using the stdarg.h library. For those of us working in Cocoa, Apple has already included the import in … Continue reading
Posted in Uncategorized
Leave a comment