Fixed deprecations in ViewController.m and made to work in simulator as well. Though xcode may still give warnings.