top
about archive search zqueue.com
Matt Gallagher: Cocoa with Love Matt Gallagher: Cocoa with Love
← Newer 10 11 12 13 14 15 16 17 18 Older →
  • Method names in Objective-C

    Jun 10, 2009 (an Objective-C era article)

    Compared to other languages, method names in Objective-C are weird. They're long, they're wordy, they include names for the parameters and they seem to repeat information you can get elsewhere. Despite these apparent negatives, Objective-C method naming can save you time and effort. I'll show you how methods are named so that you can predict them without documentation and understand how methods work and how they use their parameters from their names alone.
    Read more...
  • Base64 encoding options on the Mac and iPhone

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

    On Unix platforms, a common approach for Base64 encoding is to use libcrypto (the OpenSSL library). However, like most C libraries, you need to wrap it to integrate with Objective-C data types (like NSData and NSString) and it isn't available on the iPhone. I'll show you how to handle base64 encoding/decoding with OpenSSL and without so you can handle the Mac and iPhone equally.
    Read more...
  • Simple methods for date formatting and transcoding

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

    There is no single-line method for converting between formatting date strings and date objects in Cocoa — the API opts for flexibility rather than simplicity. Unfortunately, this combines with documentation that omits, misdirects and occasionally misinforms, making NSDateFormatter one of the more confusing classes for new Cocoa programmers. In this post, I'll try to address some of the documentation issues and I'll present some methods that will turn NSDate into a formatted string or convert between date strings in a single method.
    Read more...
  • Intercepting status bar touches on the iPhone

    May 19, 2009 (an Objective-C era article)

    You can configure your iPhone applications so that a touch in the status bar will scroll a UIScrollView to the top. I'll show you how you can intercept this touch event to use status bar touches for other purposes. The sample application will show a hidden drawer that slides out from the status bar when you tap it.
    Read more...
  • Variable argument lists in Cocoa

    May 10, 2009 (an Objective-C era article)

    This week I'll talk about methods that take variable numbers of arguments, also known as variadic methods. I'll show you the Objective-C syntax and implementation, give a quick rundown of the ways that Cocoa classes provide variable argument support and I'll also show you a way to fake va_list parameters to handle Cocoa's variadic method equivalents at runtime.
    Read more...
  • Invoking other processes in Cocoa

    May 4, 2009 (an Objective-C era article)

    Invoking other processes is a good way to handle some low-level tasks on the Mac. I'll show you some simple ways to invoke processes and parse their outputs in Cocoa apps as well as some advanced tricks like running a process with administrator privileges.
    Read more...
  • Easy custom UITableView drawing

    Apr 28, 2009 (an Objective-C era article)

    It is really easy to customize your UITableViews. I'll show you how to completely customize the appearance of UITableViews without overriding or subclassing and without the need for any tricky hackery.
    Read more...
  • What does it mean when you assign [super init] to self?

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

    One of the strangest pieces of common syntax in Objective-C is the line self = [super init];. Without any explanation, this arrangement raises a few questions. Does this line set the self value for the instance? Is self just a variable like any other? If so, why have it at all? I'll address each of these questions and show how the compiler converts uses of self and method invocations.
    Read more...
  • Showing a "Loading..." message over the iPhone keyboard

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

    The "Text" (SMS) application on the iPhone uses a custom, semi-transparent view to show its "Sending..." message over the keyboard. I'll show you a simple class that can display semi-transparent loading messages and how you can display messages over the keyboard.
    Read more...
  • 8 Confusing Objective-C Warnings and Errors

    Apr 5, 2009 (an Objective-C era article)

    Objective-C's unique syntax results in unique ways of making mistakes. In this post, I look at the compiler warnings and errors GCC outputs when you make mistakes or potential mistakes in your Objective-C syntax and show you how to fix them.
    Read more...
← Newer 10 11 12 13 14 15 16 17 18 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: