Category Archives: iPhone

UIPickerView (resizing)

One of the prettiest built-in views on the iPhone is the UIPickerView, which presents a slot-machine-like list of options. Unfortunately, this view isn’t particularly easy to use, as its default presentation takes up quite a bit of screen real-estate, and … Continue reading

Posted in iPhone | Comments Off

Deep Copying

Yesterday, we discussed loading a (mutable) plist from disk. To review: there are built-in Cocoa functions that load plists, but they return immutable data structures. (Happily, Core Foundation functions exist that can create mutable plists from XML files.) Suppose you … Continue reading

Posted in iPhone | Comments Off

Mutable Plists

Property Lists, or plists, are collections of strings, numbers, booleans, dates, base64 data, arrays, and dictionaries (associative arrays). They are a standardized, flexible data structure used (among other places) throughout Mac OS X. Plists are stored as XML files on … Continue reading

Posted in iPhone | Comments Off

viewWillAppear

Some posts are of general interest, some are more narrow in their focus. This is a small post, on a specific question, to which I don’t even have all the answers. But if you’re working with Cocoa on the iPhone, … Continue reading

Posted in iPhone | Comments Off

Locked Queue

Today, something pretty simple: An implementation of a threadsafe queue in Cocoa/Objective-C, suitable for use when implementing the producer-consumer pattern. Nothing too extraordinary: I use an NSMutableArray to store the data (object ids) and the pthreads library for synchronization.

Posted in iPhone | Comments Off

Mac Mini Memory (Part 1)

I’ve been using a Mac Mini (2.0GHz Core 2 Duo/1GB memory) for iPhone development. Mostly, it’s great, but it is a little low on memory. It always seems to have enough to run whatever I’m using at the moment w/o … Continue reading

Posted in iPhone | Comments Off

Multithread Cocoa (Run Loops)

When writing multithreaded Cocoa apps (on Mac OS X or on iPhone OS) it’s necessary to consider the “run loop(s)” of your application. Run loops are the message pumps which drive (among other things) all the parts of your application … Continue reading

Posted in iPhone | Comments Off

Random Cocoa

Today, just three quick notes on iPhone development, Objective-C, and Cocoa. Briefly: The iPhone has no true fixed-width font NSMutableArray isn’t really anything like an array NSNumber lets you wrap integers and floats as objects

Posted in iPhone | Comments Off

Xcode and SVN

When setting up Xcode to use Subversion (SVN) as its Source Code Management (SCM) system for a new project, I encountered a few hiccups. Nothing too major, and I’m sure that some of them were due to my unfamiliarity with … Continue reading

Posted in iPhone | Comments Off

Xcode

Today, some random notes on Xcode (Apple’s IDE for Mac OS and iPhone OS): A few odds and ends I’ve noticed since starting to work with it a couple of weeks ago. (I like Xcode, but it does seem to … Continue reading

Posted in iPhone | Comments Off