Matt Gallagher: Cocoa with Love

Articles about Swift, Cocoa, software design and programming.

  • Mar 19, 2008

    Objective-C era

    Construct an NSInvocation for any message, just by sending

    I will show you how to use object forwarding to record any message in an NSInvocation, by simply sending the message to an object. Unlike techniques shown elsewhere, this will allow you to record any message, including NSObject messages and even the forwarding messages themselves.

    Read article

  • Mar 14, 2008

    Objective-C era

    Cocoa Application Startup

    How does a Cocoa Application start up? Where are the main places to put code so that it gets run on startup? Learn the answers in this series of startup diagrams.

    Read article

  • Mar 9, 2008

    Objective-C era

    Break into Debugger

    For your debugging pleasure: a DebugBreak() macro to programmatically stop the debugger at a line of code (not inside a child function). Some of this code can be found elsewhere but I present it here, PPC and Intel capable and ready to run.

    Read article

  • Mar 7, 2008

    Objective-C era

    Core Data: one line fetch

    It's a lot easier to get your data out of Core Data than the documentation will tell you. This simple 1-line fetch will work just as well as Apple's suggested 10-line approach for most uses.

    Read article

  • Feb 25, 2008

    Objective-C era

    IMP of the current method

    I wanted to get my new blog started with something that's unlikely to be found anywhere else. This is an obscure hack to access a fundamental piece of Objective-C data.

    Read article