Re: Small Webkit question
Re: Small Webkit question
- Subject: Re: Small Webkit question
- From: John Stiles <email@hidden>
- Date: Tue, 24 Jan 2006 17:19:14 -0800
On Jan 24, 2006, at 4:33 PM, Daniel Jalkut wrote:
On Jan 24, 2006, at 6:53 PM, John Stiles wrote:
id oldDelegate = [myWebView policyDelegate];
[myWebView setPolicyDelegate: self];
...
[myWebView setPolicyDelegate: oldDelegate];
Well yeah, that will work. But if NULL is acceptable, it's nice to
carry around less state.
It's impossible for NULL to be universally acceptable, unless NULL
was the value before you set your delegate :)
That being said, since you own the web view, you get to decide who
the delegate is, and NULL (or nil) is the correct value for "no
delegate."
I sense in your original question some wonderment about whether
Apple might use the delegate mechanism to provide internal workings
of the class. This would be a major violation of the concept of
delegation being used for handing control to an outside client. I
don't think you ever have to worry about replacing a delegate that
you didn't set yourself.
Yup, you understood what I was getting at. I wasn't worried about
some other portion of my code setting the delegate to something else
behind my back :)
Thanks for the clarification.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden