I'm writing my first Objective-C Class. It's responsible for interaction with an HTTP SSO authentication service.
The process requires multiple HTTP transactions in order to complete. The Class acts as a
NSURLConnectionDelegate for its own
NSURLConnection object. The
NSURLConnectionDelegate object operates asynchronously.
I need to disallow an authentication attempt when another is in progress. I have an idea of how to do that myself, but want to know of design patterns for this situation.
My existing idea is to check an instance variable to see if an authentication is underway and if so simply not start another. However, I'm unsure how to communicate this back to the calling Class. My method presently returns void. Should I use an NSError and return that if another authentication attempt is underway?