Added methods for casting NSObjects.