It's not possible to do what you're literally asking; the NSURLConnction
must have an object as its delegate, because it's going to send specific messages, from the delegate protocol, to that object. Functions can't respond to messages. (There's no reason you can't define your delegate class in this file, however.)
There are some options for creating on-the-spot delegates which you might find useful, and in this particular case, you could use +sendSynchronousRequest:returningResponse:error: