Category Archives: learning

Printing in iOS

This post gives a quick introduction on how to print in iOS 4.2+. There are multiple ways to interact with AirPrint, but for brevity I’ll focus on printing a single PDF document.  This actually covers a lot of cases, since anything you can draw in Quartz can be drawn into a piece of PDF data […]

iOS Quick Questions

This post introduces a publicly editable table of quick iOS questions and their answers.  Think of it as a very lite version of focused on iOS.  For example, you might ask the question, “How do I cancel a UIView animation?” and the answer is to use the [CALayer removeAllAnimations] method.  This question/answer pair is […]

Clash-happy method names

This post lists a few special-case method names that are somewhat likely to be used accidentally by you but can only be used correctly if you understand their built-in functions.  Specifically: class, description, load, and hash. Why it’s tricky, by example Here’s an easy way to mess this up: start with a model object meant […]

UIView + position

Placing and moving your views can be a little tricky if you don’t know the details of UIView’s frame, bounds, and center properties.  This post gives a quick intro to those along with a useful category for working with them (code link below) called UIView+position. frame, bounds, and center These are the three properties of […]

The pogo stick of NSRunLoop

Quick intro to NSRunLoop NSRunLoop is the object that manages the big event loop in the sky. Imagine you’re writing your own graphical OS.  A common way to build your control flow is with a loop like this: while(!UserRequestedShutDown(userInput)) { userInput = GetUserInput(); KeyApplicationHandleUserInput(userInput); } The loop continuously gathers and reacts to the user’s actions […]

IBOutlet and IBAction

One of the first big confusions I confronted when learning to work with xcode and Interface Builder was the connection between things in my code (particularly those marked as IBOutlets or IBActions) and corresponding things in Interface Builder.  In many languages, you expect every file you work with to be explicitly mentioned by name somewhere […]