Re: Question about NSURLRequest
Re: Question about NSURLRequest
- Subject: Re: Question about NSURLRequest
- From: tiennou <email@hidden>
- Date: Thu, 4 Oct 2007 18:44:05 +0200
Le 4 oct. 07 à 18:13, Nick Zitzmann a écrit :
On Oct 4, 2007, at 9:20 AM, tiennou wrote:
Also I guess it could be better to handle specific protocols by
subclassing from NSURLRequest ?
I can't think of any good reason to subclass NS(Mutable)URLRequest.
If you want to add a new protocol, then you need to subclass
NSURLProtocol.
Sorry I made myself unclear ;-).
I'm subclassing NSURLProtocol to handle this, and I access protocol-
specific options of an 'incoming' request by calling [NSURLProtocol
propertyForKey:LDAPSimpleBindProperty inRequest:[self request]] (this
one to allow the use to choose between SASL and simple bind). As I'm
developing this thinking about how I'll use my LDAP classes, I'll
need to create an NSMutableURLRequest, since I'll need to call
[theRequest setValue:[NSNumber numberWithBool:YES]
forLDAPOption:LDAPSimpleBindProperty] on it.
It think it would feel better with NSURLRequest having only protocol-
specific subclasses (as NSHTTPURLRequest), not just a mutable
subclass...
Or maybe I'm doing something wrong ;-)
Etienne Samson_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden