Fix use of deprecated Objective C methods.