January 18 11
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 […]
November 14 10
This post introduces a publicly editable table of quick iOS questions and their answers. Â Think of it as a very lite version of stackoverflow.com 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 […]
June 22 10
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 […]
April 13 10
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 […]
March 26 10
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 […]
March 13 10
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 […]