Update Cocoa main file to replace deprecated method calls