NSBlog
"A failure in the hot air department"
assembly autorelease c cocoa(4) dwarf evil fridayqna(15) guest iphone letsbuild(15) macho memory notifications objectivec(10)
Friday Q&A 2013-05-17: Let's Build stringWithFormat:
at 2013-05-17 14:40
by Mike AshTags: fridayqna letsbuild c objectivec cocoa
Our long effort to rebuild Cocoa piece by piece continues. For today, reader Nate Heagy has suggested building
NSString's stringWithFormat: method.Friday Q&A 2013-03-22: Let's Build NSInvocation, Part II
at 2013-03-22 14:57
by Mike AshTags: fridayqna letsbuild objectivec
Last time on Friday Q&A, I began the reimplementation of parts of
NSInvocation as MAInvocation. In that article, I discussed the basic theory, the architecture calling conventions, and presented the assembly language glue code needed for the implementation. Today, I present the Objective-C part of MAInvocation.Friday Q&A 2013-03-08: Let's Build NSInvocation, Part I
at 2013-03-08 14:33
by Mike AshTags: fridayqna letsbuild objectivec
It's time for another trip into the nether regions of the soul. Reader Robby Walker suggested an article about
NSInvocation, and I have obliged, implementing it from scratch for your amusement. Today I'll start on a guided tour down the hall of horrors that is MAInvocation, my reimplementation of the NSInvocation API. It's a big project, so today I'm going to focus on the basic principles and the assembly language glue code, with the rest of the implementation to follow.Friday Q&A 2013-02-22: Let's Build UITableView
at 2013-02-22 15:35
by Matthew EltonTags: fridayqna iphone letsbuild
Friday Q&A is driven by the readers, and that's especially true today. Reader Matthew Elton thought that "Let's Build UITableView" would make a good topic for Friday Q&A, but he decided he'd rather implement it himself and write it up rather than wait for me to do it (good move, Matthew). Without further ado, here is Matthew's article an building
UITableView.Friday Q&A 2013-02-08: Let's Build Key-Value Coding
at 2013-02-08 14:17
by Mike AshTags: fridayqna letsbuild objectivec
Last time, I showed how to build the basic functionality of
NSObject. I left out key-value coding, because the implementation of valueForKey: and setValue:forKey: is complex enough to need its own article. This is that article.Friday Q&A 2013-01-25: Let's Build NSObject
at 2013-01-25 15:32
by Mike AshTags: fridayqna letsbuild objectivec
The
NSObject class lies at the root of (almost) all classes we build and use as part of Cocoa programming. What does it actually do, though, and how does it do it? Today, I'm going to rebuild NSObject from scratch, as suggested by friend of the blog and occasional guest author Gwynne Raskind.Friday Q&A 2012-11-30: Let's Build A Mach-O Executable
at 2012-11-30 17:59
by Gwynne RaskindTags: assembly macho fridayqna guest evil dwarf letsbuild
This is something of a followup to my last article, dyld: Dynamic Linking On OS X, in which I explored how the dynamic linker
dyld does its job. This week, I'm going to recreate the function of both the compiler and the static linker, building a Mach-O binary completely from scratch with only the help of the assembler.Friday Q&A 2012-11-16: Let's Build objc_msgSend
at 2012-11-16 14:27
by Mike AshTags: fridayqna objectivec letsbuild
The
objc_msgSend function underlies everything we do in Objective-C. Gwynne Raskind, reader and occasional Friday Q&A guest contributor, suggested that I talk about how objc_msgSend works on the inside. What better way to understand how something works than to build it from scratch? Let's build objc_msgSend.Friday Q&A 2012-07-27: Let's Build Tagged Pointers
at 2012-07-27 13:35
by Mike AshTags: fridayqna objectivec letsbuild
Last time on Friday Q&A, I discussed a hypothetical implementation of the
NSNumber class. Starting on Mac OS X 10.7 and iOS 5, NSNumber uses a new runtime facility called tagged pointers to increase speed and reduce memory usage, the inner workings of which I want to examine today.Friday Q&A 2012-07-06: Let's Build NSNumber
at 2012-07-06 15:08
by Mike AshTags: fridayqna objectivec letsbuild
NSNumber is a deceptively simple class with some interesting implementation details. In today's edition of Friday Q&A, I'll explore how to build a class that works like NSNumber, a topic suggested by Jay Tamboli.Friday Q&A 2012-03-16: Let's Build NSMutableDictionary
at 2012-03-16 14:55
by Mike AshTags: fridayqna objectivec letsbuild
Last time on Friday Q&A, we discussed how to implement
NSMutableArray. Today, I'll repeat the same exercise with NSMutableDictionary and build an implementation of it from scratch.Friday Q&A 2012-03-09: Let's Build NSMutableArray
at 2012-03-09 13:44
by Mike AshTags: fridayqna objectivec letsbuild
Collection classes are ubiquitous in Cocoa apps, but also fairly opaque. Today, at the suggestion of Matthew Elton, I'm going to take a look at how
NSMutableArray works behind the scenes by building a replacement for it from scratch.Friday Q&A 2011-09-16: Let's Build Reference Counting
at 2011-09-16 14:00
by Mike AshTags: fridayqna cocoa memory letsbuild
Last time, I discussed how to build
NSAutoreleasePool and how it works internally. Today, I'm going to carry that theme forward by building an implementation of Cocoa reference counting with retain and release, a topic suggested by David Dunham.Friday Q&A 2011-09-02: Let's Build NSAutoreleasePool
at 2011-09-02 16:30
by Mike AshTags: fridayqna cocoa autorelease letsbuild
It's that time again: time for more programming craziness. Dallas Brown suggested that I talk about how
NSAutoreleasePool works behind the scenes. I decided that the best way to do that would be to simply reimplement it, and that is what I'll discuss today.Friday Q&A 2011-07-08: Let's Build NSNotificationCenter
at 2011-07-08 16:11
by Mike AshTags: fridayqna cocoa notifications letsbuild
Notifications in Cocoa are extremely useful and are pervasive in Cocoa programming. Unfortunately, a lot of Cocoa programmers see the notification system as something of a black box: a notification is posted, Stuff Happens, and somehow the observer gets notified. Fortunately, the Stuff that Happens is actually pretty simple, and to explore it, I'm going to reimplement an
NSNotificationCenter workalike from scratch to illustrate how it all works, a topic suggested by Dylan Copeland.