top
about archive search zqueue.com
Matt Gallagher: Cocoa with Love Matt Gallagher: Cocoa with Love
← Newer 7 8 9 10 11 12 13 14 15 Older →
  • Multiple copy buffers, cursor and tab key tricks in Xcode

    Dec 12, 2009 (an Objective-C era article)

    This week, I'll show you a few keyboard related tricks for editing in Xcode, including setting up multiple copy-and-paste buffers by adjusting the key mappings, switching tabs on or off for autocomplete and other text editing quirks in Xcode like understanding why the "End" key doesn't move to the end of the line on the Mac.
    Read more...
  • The design of an iPhone application

    Dec 8, 2009 (an Objective-C era article)

    In this post, I'll discuss iPhone program design using the example of a small but non-trivial iPhone application to provide examples of how the design is implemented. The design includes: how to manage data coming from different sources, how to manage multiple views of that data and how to design your program so it remains simple and manageable as it grows. In short, I'll be discussing how Model-View-Controller (MVC) applies to an iPhone application but I'll also discuss how even simple programs are considerably more hierarchic through their controllers and branched through their models and views than the basic description "Model-View-Controller" might imply.
    Read more...
  • There's a Garbage Collection ninja hiding in the project templates

    Dec 1, 2009 (an Objective-C era article)

    Not all Xcode project templates are alike. Especially the Core Data Command Line Tool...
    Read more...
  • Writing a parser using NSScanner (a CSV parsing example)

    Nov 30, 2009 (an Objective-C era article)

    Comma-separated value (CSV) files are one of the most commonly used data formats for exchanging rows of simple data. There are many implementations of CSV parsing for Cocoa strings but the purpose of this post is to use the example of an RFC4180 compliant CSV parser implementation to show you the basics of writing a recursive descent parser for importing data into your Cocoa applications.
    Read more...
  • Performance tests: Replacing Core Data Key Paths

    Nov 21, 2009 (an Objective-C era article)

    In Mac OS X 10.5, Core Data switched from using valueForKey: as the recommended way to access Core Data attributes and relationships to auto-generated accessor methods. This new approach is faster for fetching values but lacks NSKeyValueCoding's ability to coalesce the values extracted from every object in a "to-many" relationship in a single statement. In this post, I'll look at replacing the NSSet traversal and NSSet coalescing abilities offered by NSKeyValueCoding with an approach that invokes accessor methods directly to see if I can bring some of the performance improvement of auto-generated accessor methods to situations involving NSSet traversals.
    Read more...
  • A drop-in fix for the problems with NSHost

    Nov 14, 2009 (an Objective-C era article)

    As pointed out by Mike Ash in his recent Friday Q&A 2009-11-13: Dangerous Cocoa Calls, NSHost is not thread-safe for use outside of the main thread and due to potentially slow, synchronous network access is not really suitable for use on the main thread either. Fortunately, in Cocoa there are often ways to transparently fix classes that don't work as they should. In this post, I'll show you how you can transparently patch NSHost using a drop-in solution and provide a non-blocking solution for NSHost lookups.
    Read more...
  • Creating iPhone and Mac icons using Inkscape (Part 2 of 2)

    Nov 6, 2009 (an Objective-C era article)

    In this part, I expand on the simple techniques presented in the first part by adding different line, effect and texture styles. I'll also present some Mac application icons and simple texturing.
    Read more...
  • Creating iPhone and Mac icons using Inkscape (Part 1 of 2)

    Nov 3, 2009 (an Objective-C era article)

    In this two part series, I'll give a beginner's guide to creating iPhone and Mac application icons using Inkscape — a free, vector illustration program. In this first part, I'll talk about the common styles and traits of icons on the Mac and iPhone and give a step-by-step guide to creating the first iPhone icon in Inkscape.
    Read more...
  • Memory and thread-safe custom property methods

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

    Objective-2.0 property methods are a nice convenience but if you need to override a property implementation — particularly an atomic, retained or copied object setter property — there are some potential bugs you can create if you don't follow the rules carefully. I'll show you the pitfalls and the correct way to implement a property accessor. I'll also show a way to directly invoke hidden runtime functions to let Objective-C perform atomic getting and setting safely for you.
    Read more...
  • How blocks are implemented (and the consequences)

    Oct 18, 2009 (an Objective-C era article)

    This post is a look at how clang implements blocks and how this implementation leads to a number of strange behaviors including local variables that end up global, Objective-C objects allocated on the stack instead of the heap, C variables that behave like C++ references, Objective-C objects in non-Objective-C languages, copy methods that don't copy and retain methods that don't retain.
    Read more...
← Newer 7 8 9 10 11 12 13 14 15 Older →
  • Subscribe: RSS or JSON
  • Twitter: @cocoawithlove
  • Github: mattgallagher

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