*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[AVMIDIPlayer<0x1135835b8> init]: cannot init a class object.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d361bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x00000001092d4735 objc_exception_throw + 48
2 CoreFoundation 0x0000000109d555cf +[NSObject(NSObject) init] + 127
3 riedfull 0x0000000104ae7034 ffi_call_unix64 + 76
4 ??? 0x00006000025dba00 0x0 + 105553155963392
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Then, I reduced the code to:
AttributeError: 'AVMIDIPlayer' object has no attribute 'prepareToPlay'
And surely you can image what happened when I removed the line with prepareToPlay. If not, the error was
AttributeError: 'AVMIDIPlayer' object has no attribute 'play'
Any idea about how can I do this?