About Search Archive
Matt Gallagher: Cocoa with Love Matt Gallagher: Cocoa with Love
← Newer 13 14 15 16 17 18 19 20 21 Older →
  • Method invocation formatting styles in Objective-C

    Nov 29, 2008 (an Objective-C era article)

    While most traits of Objective-C follow consistent styles, method invocation formatting — arguably a defining characteristic of the language — does not. In this post, I'll look at a handful of approaches that different programmers use to format their method invocations and discuss their advantages and disadvantages.
    Read more...
  • Automated user interface testing on the iPhone

    Nov 23, 2008 (an Objective-C era article)

    Automated testing of application user interfaces can be tricky since user interfaces are designed for use by humans not automated tools. The iPhone is particularly challenging since existing tools that aid user interface testing on the Mac are not available. This post will show you a way to run automated, scripted tests on an iPhone app's user interface.
    Read more...
  • Singletons, AppDelegates and top-level data.

    Nov 16, 2008 (an Objective-C era article)

    If you require only a single instance of an object in your application, where should it go? How should you control and manage it? Here are some different approaches, their implementations, their strengths and their weaknesses.
    Read more...
  • Simplifying your code using NSDictionary

    Nov 10, 2008 (an Objective-C era article)

    Computers programs are good at mindless repetitive tasks, they are not good at broad decision trees. In this post, I will show you a way of eliminating conditionals from your code that are based on program state by using an array of NSDictionary objects to maintain state.
    Read more...
  • Using libxml2 for XML parsing and XPath queries in Cocoa

    Oct 31, 2008 (an Objective-C era article)

    NSXMLDocument is the normal tree-based XML parser in Cocoa. But if you're writing for the iPhone, this class isn't available. Even on the Mac, sometimes you want tree-based parsing without the full overhead of NSXMLDocument. Here's how to use libxml2 to perform tree-based parsing in a Cocoa-friendly way.
    Read more...
  • Debugging tips for Objective-C programming

    Oct 25, 2008 (an Objective-C era article)

    This post is about getting extra information from your program at runtime. Xcode and gdb both support a wide range of information access tools — but you need to know that they're there. Here are some Objective-C specific gdb tips and commands that all Cocoa programmers should know.
    Read more...
  • Synthesizing a touch event on the iPhone

    Oct 17, 2008 (an Objective-C era article)

    The iPhone lacks specific methods to create UIEvent and UITouch objects. I'll show you how to add this functionality so you can write programmatically driven user-interfaces.
    Read more...
  • WorldTimeConverter: Dates and timezones in Cocoa

    Oct 10, 2008 (an Objective-C era article)

    Recently, I searched for a world time converter — one that would handle future dates as well as the current time. There are web versions but I didn't find a genuine Mac OS X application that matched my desires. How hard could it be? The answer is 1 subtraction — provided you can find the right values to subtract. Read on and I'll show you how it's done.
    Read more...
  • Sliding UITextFields around to avoid the keyboard

    Oct 3, 2008 (an Objective-C era article)

    It's an iPhone post because I finally can. Here's a good way to slide your view around when editing UITextFields so that they never get trapped under the onscreen keyboard. I'll be giving a talk at the Brisbane Cocoaheads meeting this Monday evening (Oct 6). Come along and heckle.
    Read more...
  • Streaming and playing an MP3 stream

    Sep 28, 2008 (an Objective-C era article)

    This week, I present a sample application that streams and plays an audio file from a URL on the iPhone or Mac. I'll show how the application was written by expanding upon Apple's AudioFileStreamExample, including a work-around for an Audio File Stream Services' crash bug when handling streaming MP3s.
    Read more...
← Newer 13 14 15 16 17 18 19 20 21 Older →
  • Subscribe: RSS or JSON
  • Mastodon: @cocoawithlove
  • Bluesky: @cocoawithlove
  • Github: mattgallagher

© 2008-2024 Matt Gallagher. All rights reserved.
Code may be used in accordance with license on About page.
If you need to contact me: