Search code examples
iosios9

MPMediaItemArtwork crashed in iOS9


if (image) {
    MPMediaItemArtwork *media = [[[MPMediaItemArtwork alloc] init] initWithImage:image];  //crashed in this line,iOS9.
}

Error info:

ERROR: 258: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681). NSScanner: nil string argument

Why MPMediaItemArtwork crashed in iOS9?


Solution

  • I also experienced crashing with the MPMediaItemArtwork initialization on the IOS9.

    Try to change your line of code to this one:

    MPMediaItemArtwork *media = [[MPMediaItemArtwork alloc] initWithImage:image];

    Would be happy to know if it helped anyone