• 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: CocoaUI & factory class design pattern in ObjC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CocoaUI & factory class design pattern in ObjC


  • Subject: Re: CocoaUI & factory class design pattern in ObjC
  • From: Ian Kemmish <email@hidden>
  • Date: Thu, 11 Aug 2005 20:44:44 +0100

Well, I can confirm that it's perfectly possible for nib loading to occur during -init instead of during uiViewForAudioUnit:withSize: with no ill effects.

I'm a polyglot rather than an expert: my code does it that way because that's what I found in my old copy of NextStep programming.

Unfortunately, if I read Brian's mail aright, the real problem is out of the hands of the AU, up in the host, which may or may not choose to release the File's Owner early.

I suspect therefore that it's too late to mend that, though it should probably be addressed for the sake of correctness.

Am I right in supposing that the existing situation will be safe so long as nothing in the loaded Nib references File's OWner? If so, that should probably be added to the Readme's and sample code in very large type....


It should be equally
possible to engineer a normal nib, whose File's Owner sticks around,
such that freeing the uiView does the right thing. It might require an
extra method call...

My hunch is that you could do that if you knew all hosts, for all time, were going to do the "wrong" thing. If you address the problem by having the view retain File's Owner in -init and release it in - dealloc, then you risk creating a memory cycle with any host that does the "right" thing.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952 854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Fragile code in AUBase.h (diff provided)
  • Next by Date: [NOOB] Layering multiple AIFFs in PCM format?
  • Previous by thread: CocoaUI & factory class design pattern in ObjC
  • Next by thread: Cocoa Host + Carbon AU View tech note?
  • Index(es):
    • Date
    • Thread