Hi,
I noticed that each time I change the number of parameters of my iOS auv3 plugin, when reloading a project saved with the previous number of parameters with any host (Garageband, AUM,…), I’m getting a crash in the call to setFullState :
ObjCMsgSendSuper<AUAudioUnit, void> (au, @selector (setFullState:), state);
(note: in my case the crash happens when 2 instances are loaded in the project, but I think this is only a detail)
The error is:
uncaught exception 'NSInternalInconsistencyException', reason: 'Archive under main: corrupt type: 16'
So, I have a feeling that this might not be a JUCE issue , but just a bug of the Apple AudioToolkitCore framework when it tries to deserialize its own data.
However, is this data really useful ? Looking at the Apple doc here:
it says:
The base class implementation of this property saves the values of all parameters currently in the parameter tree.
So it seems we can just skip this call, none of the other juce plugin formats are saving the individual values of parameters , they just use the AudioProcessor::getStateInformation.
And then if I comment the calls to
ObjCMsgSendSuper<AUAudioUnit, NSDictionary<NSString*, id>*> (au, @selector (fullState));
and
ObjCMsgSendSuper<AUAudioUnit, void> (au, @selector (setFullState:), state);
in juce_AUv3_Wrapper.mm then the plugin is state is still correctly saved and restored , and I’m not getting that crash anymore.