Re: using a virtual C++ function
Re: using a virtual C++ function
- Subject: Re: using a virtual C++ function
- From: "Florian G\. Pflug" <email@hidden>
- Date: Wed, 11 Jun 2003 00:35:41 +0200
On Tue, Jun 10, 2003 at 09:51:42AM -0400, Robert Palmer Jr wrote:
>
After sending this request, I played some more and stumbled on this
>
very idea. The only reason mine didn't work was that I forgot to call
>
the init() function (see #2 below) - even better reason for using the
>
constructor to initialize the member variable. I implemented it a
>
little differently and had omitted two things.
>
1. I didn't have the [delegate retain/release] calls - why are they
>
needed?
I guess it depends. If you are sure, that someone else holds the retainCount
at at least 1, then you don't need to retain/release it in the proxy class.
But I thought it's cleaner that way. And since searching for Sensors
probably takes far more time then one retain and one release, there isn't
really a downside to retaining/releasing the delegate.
But I'm no cocoa expert, so I might be wrong... ;-)
>
I think there are a couple of typos in your code, but here's what I
>
ended up with and it works like a charm.
Sorry for the typos ;-) And I'm glad I could help...
greetings, Florian Pflug
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.