Archive for the “Cocoa” category

Why are there two NSObjects in Cocoa?

by john on November 4, 2013

Mike Ash does a bang up job answering this question: There are two NSObjects in Cocoa, a class and a protocol. Why both? What purpose do they serve? Mike briefly covers namespaces, root classes, proxies and protocols.

Cocoa turns 19 years old, a little history

by john on October 28, 2013

Graham Lee on the history of Cocoa: First there came message-passing object oriented programming, in the form of Smalltalk. Well, not first, I mean first there was Simula 67, and there were even things before that but every story has (…)

Read the rest of this entry »

Introduction to Protocols

by john on April 26, 2013

What follows is a quick introduction to working with protocols. This is good background information to understand as protocols are common in various Cocoa frameworks. A protocol is means to define a list of required and/or optional methods that a (…)

Read the rest of this entry »

Basics of Notifications

by john on April 14, 2013

What follows is a brief guide to working with Notifications in Cocoa. I’ll cover the basics, including registering an observer and posting notifications, just enough to start using notifications in your apps. There is an instance of NSNotificationCenter available to (…)

Read the rest of this entry »

Date Formatters – Part 3

by john on January 16, 2009

While working on an iPhone application recently, I needed to convert a date read from an XML stream that was in the following format: 20081122 to a nicely formatted string for display on the device: Saturday November 22, 2008.

Date Formatters – Part 2

by john on January 9, 2009

In the first post on working with dates several of the examples use the “old style” date format syntax. The examples work, however, I want to show an additional example that uses the ICU (International Components for Unicode) library for (…)

Read the rest of this entry »

Date Formatters – Part 1

by john on December 30, 2008

Sometimes all you’re really looking for is a basic chunk of code to get something done. For example, I was working on an application yesterday and needed to display the current date in text format: October 29, 2008. A simple (…)

Read the rest of this entry »

Minnesota CocoaHeads Recap

by john on September 12, 2008

The Minnesota CocoaHeads met tonight and it was an interesting spin on development for the Mac. Troy Gaul did a presentation on Adobe Lightroom, from the perspective of the development tools and approach used to create Lightroom. Although I have (…)

Read the rest of this entry »

Filename and Line Number with NSLog: Part II

by john on August 20, 2008

In the previous post (on the iPhone Developer Tips blog) I demonstrated a simple debug class that I wrote to wrap some additional code around NSLog. The code allows for displaying additional information beyond the date/time stamp and process ID (…)

Read the rest of this entry »

Filename and Line Number with NSLog: Part I

by john on August 19, 2008

Coming from a C development background, long before the days of integrated debuggers, printf() was the primary tool for tracking down bugs. Building on that, NSLog is no doubt helpful. However, as the amount of code in a project grows, (…)

Read the rest of this entry »

CocoaHeads MN: Objective-C

by john on July 11, 2008

Lastnight was the second meeting for CocoaHeads in Minnesota . The meeting was all about Objective-C. Bob McCune , the organizer of the event, gave a talk that covered Objective-C from beginning to end. One of the most intriguing aspects (…)

Read the rest of this entry »