mikeash.com: just this guy, you know?

NSBlog
"A failure in the hot air department"
RSS feed (full text feed) - Show Tag Cloud
Showing entries tagged "letsbuild". Full blog index.

by Mike AshTags: fridayqna letsbuild gcd
Grand Central Dispatch is one of the truly great APIs to come out of Apple in the past few years. In the latest installment of the Let's Build series, I'm going to explore a reimplementation of the most basic features of dispatch_queue, a topic suggested by Rob Rix.

by Mike AshTags: fridayqna letsbuild swift
Swift 1.2 is now available as part of Xcode 6.3, and one of the new APIs it includes allows us to build efficient data structures with value semantics, such as Swift's built-in Array type. Today, I'm going to reimplement the core functionality of Array.

by Mike AshTags: fridayqna letsbuild threading swift
Continuing the theme of thread safety from the previous article, today I'm going to explore an implementation of Objective-C's @synchronized facility in the latest edition of Let's Build. I'm going to build it in Swift, although an equivalent Objective-C version would be much the same.

by Mike AshTags: fridayqna letsbuild notifications swift
NSNotificationCenter is a useful API that's pervasive in Apple's frameworks, and often sees a lot of use within our own code. I previously explored building NSNotificationCenter in Objective-C. Today, I want to build it in Swift, but not just another reimplementation of the same idea. Instead, I'm going to take the API and make it faster, better, stronger, and take advantage of all the nice stuff Swift has to offer us.

by Mike AshTags: fridayqna letsbuild gcd
Dispatch groups are a handy facility for synchronizing multiple tasks, and an anonymous reader suggested them for the subject of today's Let's Build.

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.

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.

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.

by Matthew EltonTags: fridayqna iphone letsbuild guest
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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.
Hosted at DigitalOcean.