Matt Gallagher: Cocoa with Love

Articles about Swift, Cocoa, software design and programming.

  • Jan 31, 2011

    Objective-C era

    Advanced drawing using AppKit

    In this post, I'll look at drawing a detailed image in code by combining multiple visual elements. Unlike previous posts I've done on drawing in Cocoa, this will focus on the AppKit classes. The code will use NSGraphicsContext, NSBezierPath, NSAffineTransform, NSGradient, NSGlyph and show you some simple ways to export the contents of an NSView to a file.

    Read article

  • Jan 26, 2011

    Objective-C era

    Submitting functionality for a future version of iOS

    A number of websites are reporting that my application, StreamToMe 3.5 was approved with mention of a piece of future iOS functionality. While this was actually the case, it does not mean that Apple have started accepting apps for this new version of iOS.

    Read article

  • Dec 19, 2010

    Objective-C era

    UITableView construction, drawing and management (revisited)

    In this post, I'll show you the current classes I use to construct and manage UITableViews in a number of different projects. This code is an amalgamation and evolution of some ideas that I've presented in a few earlier posts including my posts on heterogenous cells in a table view and easy custom table view drawing. But this implementation also chooses to do some things differently in an effort to continuously simplify the task of creating customized tables and views in iOS.

    Read article

  • Dec 12, 2010

    Objective-C era

    Version control for solo Mac developers

    In this post, I'll take a quick look at how to keep your projects in git and how to manage that easily on the Mac. More importantly though, I'll take a look at why you'd want to do this, even if you're the only developer, you don't need to share your code, you don't have formalized releases that need to be tagged and you already have a backup system protecting your code.

    Read article

  • Nov 20, 2010

    Objective-C era

    Back to the Mac? 12 features from iOS I'd like to see in Lion

    A few user-features of Mac OS X Lion have been announced but no Cocoa API changes have been publicly announced. However, I think there are dozens of non-user areas where the Cocoa Mac APIs could be improved by integrating approaches from Cocoa Touch APIs. What follows are a dozen areas where I'd like to see a more iOS approach in Mac OS X Lion.

    Read article

  • Nov 12, 2010

    Objective-C era

    A Cocoa application for running scripts

    Last week, I showed a bash script that you can use to build, tag and package a Mac application. As I'll show you this time though, I prefer to use a compiled Mac application to do the same thing. The important code here is a set of classes that support script-like invocations of other programs and support for a structured build-log based on the results of each step.

    Read article

  • Nov 5, 2010

    Objective-C era

    A deployment script for a generic Cocoa Mac application

    Deployment for a Cocoa Mac application normally involves a few common steps: committing code into a repository, updating version numbers and packaging the application as a DMG disk image. In this post, I'll show you a combination bash/perl/Applescript to handle all these tasks in a single script.

    Read article

  • Oct 6, 2010

    Objective-C era

    Testing if an arbitrary pointer is a valid object pointer

    In this post, I look at an approach for testing if an arbitrary pointer is a pointer to a valid Objective-C object. The result from the test is not absolutely accurate and can interfere with gdb debugging if the pointer isn't a valid memory location, so this is not something you'd want to do often (and certainly not in production code). But it can be a handy debugging tool for when you're staring blindly at memory you didn't allocate.

    Read article