Category Archives: Uncategorized

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

Importing a Framework

Commonly when working with the iPhone SDK we run into a situation where the specific library we need is in a precompiled framework. These frameworks are libraries: collections of functionality thrown together into one package. Using a framework is easy: … Continue reading

Posted in Uncategorized | Leave a comment

Patterns in Objective-C: Observer Pattern

One of the most common patterns, after the Singleton, in Java is the Observer Pattern. Also referred to as a Broadcaster/Listener or a Publish/Subscribe pattern. The basic principle is that there are two components: An Observer (or Listener) and a … Continue reading

Posted in Uncategorized | 1 Comment

Static Constant Strings in Objective-C

One of the most commonly used features in Java is the ability to avoid string “magic constants” by putting those strings into static variables. These values are then readily accessible inside of the class, not necessarily visible outside of it, … Continue reading

Posted in Uncategorized | 1 Comment

Patterns in Objective-C: Singleton Pattern

One of the challenges in switching to a new language is figuring out how design patterns adapt.   Sometimes the language has built-in facilities for the pattern, or features that work-around what the pattern was designed to do in the first … Continue reading

Posted in Uncategorized | Leave a comment

Python, Subversion, and revision diffs

One of my hobbies is working as an amateur translator for scripts (of the textual kind) and assorted short stories. Since I move around to different machines often, it just makes sense to put everything on subversion. Of course, when … Continue reading

Posted in Uncategorized | Leave a comment

Types of Data

There are four types of data, or levels of measurement, that show up in databases.  Everything that goes into the database or shows up on a survey corresponds to one of these levels, from address fields to income.  It is … Continue reading

Posted in Uncategorized | Leave a comment

Arrays in Python

One of the first hurdles with doing data process in python is the format of the data. Our data naturally exists in rows and matrixes, but Python generally only allows us to work with one variable at a time. We … Continue reading

Posted in Uncategorized | Leave a comment