Re: Referencing an AUGraph from a different class
Re: Referencing an AUGraph from a different class
- Subject: Re: Referencing an AUGraph from a different class
- From: Gregory Wieber <email@hidden>
- Date: Fri, 21 May 2010 15:59:27 -0700
Kyle,
Thank you for your help! Apologies for bringing what turned out to be an objective-c issue into the core audio forum. For anyone else having a similar problem, here's what it turned out to be:
I was having trouble including my parent class into my child class because the parent class imports the child's header. I very boneheadedly changed my parentController to be a type of id, which caused the issue that Kyle described above.
The correct way to do it is to use a forward class reference, which is described here:
Everything works now. Thanks again.
G
On Fri, May 21, 2010 at 3:49 PM, Kyle Sluder
<email@hidden> wrote:
On Fri, May 21, 2010 at 3:44 PM, Gregory Wieber <
email@hidden> wrote:
> parentController is in fact typed to be an id. How did you know? Let me see
> if I can clean up the controller code for posting and simplicity, and thank
> you :)
Because if the compiler hasn't seen a method before, it will assume it
takes ... and returns id. The only way this could have happened in
your case is if it had not seen the -pGraph method before, which means
that parentController could not have been typed as your parent class.
If parentController were typed as anything but id, the compiler would
have warned that parentController might not respond to -pGraph.
Hopefully this has motivated you to turn on all warnings and always
build with warnings treated as errors. It catches tons of these sorts
of bugs. It's kind of a shame that the default Xcode project template
does not do these things.
(BTW, I hope you don't mind that I've brought this back on-list.)
--Kyle Sluder
_______________________________________________
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