• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: using a virtual C++ function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: using a virtual C++ function (From: "Florian G\. Pflug" <email@hidden>)
 >Re: using a virtual C++ function (From: Robert Palmer Jr <email@hidden>)

  • Prev by Date: Re: random value (newbie)
  • Next by Date: Cocoa question for you old guys
  • Previous by thread: Re: using a virtual C++ function
  • Next by thread: Re: using a virtual C++ function
  • Index(es):
    • Date
    • Thread