currently, if we generate Swift file from the Music app (com.apple.Music), MusicTrack have a releaseDate property with Date type:
// MARK: MusicTrack
@objc public protocol MusicTrack: MusicItem {
/* (snip) */
@objc optional var releaseDate: Date { get } // the release date of this track
but, If try to get releaseDate property when Music app doesn't have current track (e.g. after re-opened), it will crash instead of returns nil:
but, If I change property type to Date? or NSDate manually, crash never occured (property returns nil).
maybe It is Apple-side issue (I'm not sure), but we might be want to include workaround for this.
Environment
- Xcode: 16.1 (16B40)
- macOS: 14.7 (23H124)
- Chip: Apple M1 Max
currently, if we generate Swift file from the Music app (
com.apple.Music),MusicTrackhave areleaseDateproperty withDatetype:but, If try to get
releaseDateproperty when Music app doesn't have current track (e.g. after re-opened), it will crash instead of returns nil:but, If I change property type to
Date?orNSDatemanually, crash never occured (property returns nil).maybe It is Apple-side issue (I'm not sure), but we might be want to include workaround for this.
Environment