Monthly Archives: December 2012

UIKit class hierarchy chart

Further on in the Apple document “Cocoa Fundamentals Guide” I also came across a nice class hierarchy chart for UIKit classes.    It is  located in the section of the document called “What Is Cocoa?“.

Continue reading

Foundation class hierarchy charts

I was reading the Apple document “Cocoa Fundamentals Guide” and ran across some nice class hierarchy charts for Foundation classes that I thought I’d share.    They are located in the section of the document called “What Is Cocoa?“.

These diagrams logically group the classes of the Foundation framework in categories.   Classes in blue-shaded areas are present in both the OS X and iOS versions of Foundation; classes in gray-shaded areas are present only in the OS X version.

Continue reading

Debugging memory leaks with Instruments and Heapshots

I was first introduced to Instruments in the CS193P course that I took over the past few months.   I found them to be invaluable for debugging memory leaks as I work on my Address Book iPhone app.

iOS Memory Instruments

Continue reading

Memory management with iOS

In creating my first iPhone app which uses the Address Book, I discovered the world of memory management with iOS.  I wanted to share a few things I’ve learned and provide lots of links for your reference.

ARC, retain counts and CFRelease

Admittedly, if you stick strictly to Foundation code, you probably don’t need to be concerned too much about what happens under the hood.   With the introduction of ARC (Automatic Reference Counting), iOS takes care of much of this for you.  It’s when you also need to deal with Core Foundation (CF), which the Address Book uses, that things become tricky.   CF has a concept of object ownership and memory management using retain counts.   An object can have multiple owners (retain count > 1), but when you are done with that object the retain count had better be zero or you’ll create memory leaks.    To accomplish this, you need to use CFRelease().

Continue reading

Clipboard Manager for coding – PTHPasteboard Pro

I was new to the Mac up until about 5 months ago.  One of the first tools I realized that I wanted was a good clipboard manager.  Why?  I make extensive use of notes (Evernote), code comments and README files to paste examples of code, links to references, etc.  I often found myself switching back and forth between windows with copy/paste, copy/paste, etc.   What I really wanted was to maximize my efficiency with copy, copy, copy … followed by paste, paste, paste …

I ran across a good article at Macworld that helped me identify some top contenders quickly:  Essential Mac utilities: clipboard managers | Macworld.

From the list of clipboard managers, I tried CopyPaste Pro and PTHPasteboard Pro.  I eventually stuck with the latter.  It fit better into my workflow, had some advanced paste features, and allowed me to exclude some tools from copying (such as 1Password) so that I wasn’t putting sensitive information like passwords onto my clipboard.

Screen Shot 2012-12-11 at 12.55.58 PM

Continue reading