The way this is done in AlfrescoRepositorySession.m is a lot cleaner i.e. just checking the object conforms to the AlfrescoNetworkProvider protocol.