Re: CocoaUI & factory class design pattern in ObjC
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