About Search Archive
Matt Gallagher: Cocoa with Love Matt Gallagher: Cocoa with Love
← Newer 7 8 9 10 11 12 13 14 15 Older →
  • Quality control in application development without unit testing

    Jan 5, 2010 (an Objective-C era article)

    In my last two posts, I've shown a Mac app with full unit tests and an iPhone app with full unit tests. The reality though is that I do not write or test code this way. In this post, I look at why so few applications are actually developed using unit tests. I'll also look at the alternate approaches — both manual and automated — that are normally used to maintain high quality and low bug rates in application development.
    Read more...
  • A sample iPhone application with complete unit tests

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

    In this post, I present a complete Cocoa Touch iPhone application implemented with unit tests for all created code. I'll look at setting up build and debug targets and executables for both Application and Logic tests, and show you some of the differences between Application and Logic tests. The code for this post is an iPhone version of the Mac post I presented last week.
    Read more...
  • A sample Mac application with complete unit tests

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

    In this post, I present a complete Cocoa Mac application implemented with unit tests for all created code. I'll create the tests first and then only add the code required to make the tests pass, largely following a test-driven development (TDD) methodology. Next week I'll show the configuration and implementation of this project as an iPhone application for the benefit of Cocoa Touch developers.
    Read more...
  • 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...
← Newer 7 8 9 10 11 12 13 14 15 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: