Convert from Objective-C from line 375 to the end
merge Control branch
finish cpp, compile without error