• 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: How To Design A Queue of Messages?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How To Design A Queue of Messages?


  • Subject: Re: How To Design A Queue of Messages?
  • From: j o a r <email@hidden>
  • Date: Sat, 10 Sep 2005 22:46:11 +0200


This thread is just too weird. I'm not sure we're even close to answering the question asked by the OP, and the suggestions received so far is all over the map...


I think that the standard rule should have been applied immediately - ie. to ask the OP to present the problem that the OP is trying to solve, and not attempt to answer the question posed.

On 10 sep 2005, at 21.26, Frode wrote:

I would use objc_sendMsg().
Any reason for not simply using performSelector:?
Does it really matter in this case?

Of course it does. Your example is (IMO) overly complex, for no apparent benefit.


Yes, of course. This was for static messages and not object messages. It should be _receiver = object

Please use the correct terminology: Class methods and Instance methods.

In fact, we should actually write _receiver = [object retain]. Retaining and releasing the target object might be needed if the queue (or in our case, sendMessages:) is later calling object's message outside the scope of present auto-release pool used when allocating a ReceiverSelectorPair-object, which is often the case.

I personally wouldn't retain my targets in such an implementation, but if you do it should be well documented. It frequently leads to weird situations where you thought that you had disposed of an object, only to realize that it was retained by something like this (or a timer). It's a pretty common source of unexpected problems / bugs.
Use a subscribe / unsubscribe pattern like in NSNotificationCenter instead.


j o a r



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: How To Design A Queue of Messages?
      • From: Andreas Mayer <email@hidden>
References: 
 >How To Design A Queue of Messages? (From: Jerry Krinock <email@hidden>)
 >Re: How To Design A Queue of Messages? (From: Andreas Mayer <email@hidden>)
 >Re: How To Design A Queue of Messages? (From: Frode <email@hidden>)
 >Re: How To Design A Queue of Messages? (From: Andreas Mayer <email@hidden>)
 >Re: How To Design A Queue of Messages? (From: Frode <email@hidden>)

  • Prev by Date: Re: How To Design A Queue of Messages?
  • Next by Date: Re: iTunes playlist icons
  • Previous by thread: Re: How To Design A Queue of Messages?
  • Next by thread: Re: How To Design A Queue of Messages?
  • Index(es):
    • Date
    • Thread