• 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: use finalize for removing AppleEvent handlers in GC apps?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use finalize for removing AppleEvent handlers in GC apps?


  • Subject: Re: use finalize for removing AppleEvent handlers in GC apps?
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 3 Jan 2008 17:24:28 -0500
  • Organization: Rogue Research

On 12/22/07 2:19 PM, Todd Ditchendorf said:

>In my all-GC cocoa app, I'm registering an AppleEvent handler:
>
>
>[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
>
>andSelector:@selector(handleGetURLAppleEvent:withReplyEvent:)
>												 forEventClass:kInternetEventClass
>													andEventID:kAEGetURL];
>
>
>It seems that before GC, you would remove this handler in the dalloc
>method. (correct me if i'm wrong there)
>
>- (void)dealloc {
>	...
>	[[NSAppleEventManager sharedAppleEventManager]
>removeEventHandlerForEventClass:kInternetEventClass
>andEventID:kAEGetURL];
>	...
>}
>
>In a GC app, should you do that removal in finalize instead? or
>somewhere else? or not at all?

Well, everything in -finalize has to be thread-safe.  Is
NSAppleEventManager thread safe?  If not, then -finalize is a very bad
place to do that.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

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

  • Follow-Ups:
    • Re: use finalize for removing AppleEvent handlers in GC apps?
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Circular initialization of controllers in NIB file
  • Next by Date: Re: NSImage to PDFPage in Tiger?
  • Previous by thread: Re: Cocoa-dev Digest, Vol 5, Issue 8
  • Next by thread: Re: use finalize for removing AppleEvent handlers in GC apps?
  • Index(es):
    • Date
    • Thread