Completed Objective-C implementation.