Reading MPMediaItem.dateAdded raises EXC_BREAKPOINT

Originator:s.pershenkov
Number:rdar://34786622 Date Originated:October 3 2017
Status:Open Resolved:
Product:iOS SDK Media Player Framework Product Version:10+
Classification:Crash Reproducible:Always
 
Area:
Media Player Framework

Summary:

// Following code raises EXC_BREAKPOINT always:
MPMediaQuery.podcasts().items?.forEach {
  print($0.dateAdded)
}

// Note that MPMediaQuery.podcasts() have to contain at least one item.

// Also, this code also raises EXC_BREAKPOINT sometimes:
MPMediaQuery.songs().items?.forEach {
  print($0.dateAdded)
}

Steps to Reproduce:

1. You need real device, not simulator.
2. Install Podcasts app from App Store to the device and download at least one podcast in it.
3. Open Xcode and run attached project on the device.

Expected Results:

Debug console prints dateAdded's of podcasts and songs on the device.

Actual Results:

EXC_BREAKPOINT raised.

Version/Build:

iOS 10+

Configuration:

iPhone 5, SE, 8, iPad 3

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!