AEAudioReceiver class in Swift

edited August 2016

I have a Swift project that uses TAAE 1.5.7. I want to have a class that inherits from AEAudioReceiver. I am doing the callback as follows

var receiverCallback: AEAudioReceiverCallback! {
   return { (receiver:AnyObject?, audioController:AEAudioController?, source:UnsafeMutablePointer<Void>, time:UnsafePointer<AudioTimeStamp>, frames:UInt32, audio:UnsafeMutablePointer<AudioBufferList>) in
   }
}

This compiles alright, however it crashes when it runs. Anybody know how to make this work?

edit

I narrowed down the problem a little bit. My class inherits from CALayer and AEAudioReceiver. It crashes only when setNeedsDisplay() is called after the class has been added as an audio receiver. The crash itself gives no useful information however, it is a bad access.

edit again

Oops I realised this is not a TAAE related issue at all. Sorry should not have posted here. It is only crashing because it inherits from CALayer and I call setNeedsDisplay().

Sign In or Register to comment.