ObjectAL from tescott changes

Just the pull request with the changes to have ObjectAL working on iOS, extracted from tescott github project. I don't know if he improved the stuff in his own fork.